Re: Reading XML 1.1
Re: Reading XML 1.1
- Subject: Re: Reading XML 1.1
- From: John Brownie <email@hidden>
- Date: Thu, 17 Mar 2016 14:27:27 +1000
On 14/03/2016 19:14, John Brownie wrote:
Is it possible to read an XML 1.1 file using NSXMLDocument? The
crucial thing for my purposes is that the character set allowed in XML
1.1 is larger. XML 1.0 defines characters as:
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
| [#x10000-#x10FFFF]
XML 1.1 defines:
#2 Char ::= [#x1-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF] /* any Unicode character, excluding the
surrogate blocks, FFFE, and FFFF. */
#2a RestrictedChar ::= [#x1-#x8] | [#xB-#xC] |
[#xE-#x1F] | [#x7F-#x84] | [#x86-#x9F]
I need to be able to handle the RestrictedChar characters, but
NSXMLDocument apparently only handles the XML 1.0 character set.
Is there a way to make NSXMLDocument handle the fuller character set?
If not, is there an alternative that will enable me to parse an XML
1.1 file with a minimum of effort?
No actual answers, but the best I've found is to use the expat XML
parser with the expatobjc wrapper, and go in and change the ASCII tables
to handle the extra characters (change from BT_NONXML to BT_OTHER). Of
course, it is not as simple as NSXMLDocument in that I have to do the
parsing myself rather than having it give me a nice tree structure which
I can walk to create my internal data structure. It would be even nicer
to have it in Swift, but I guess I can live with ObjC for now.
John
--
John Brownie, email@hidden or email@hidden
Summer Institute of Linguistics, Ukarumpa, Eastern Highlands Province,
Papua New Guinea
Mussau-Emira language, Mussau Island, New Ireland Province, Papua New Guinea
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden