Re: xml parsing
Re: xml parsing
- Subject: Re: xml parsing
- From: Mike <email@hidden>
- Date: Fri, 13 Jun 2008 22:47:10 -0700
Steve Majewski wrote:
Your example is not a valid xml file.
You should have only a single document root element.
You can check your test files first with xmllint.
( I don't use the Cocoa XML wrappers myself, but in SAX there are
config options for the parser that may affect what errors are reported.
Some errors may not show up unless you turn on validation. )
-- Steve Majewski / UVA Alderman Library
On Jun 13, 2008, at 4:54 PM, Bart Beulen wrote:
Hi All
I'm new to cocoa and working on an xml parser.
I would like to parse xml files like the following example
<poi>
<description>bla bla</description>
<image>imag1</image>
<url>http://www.blabla.com</url>
</poi>
<poi>
<description>bla bla2</description>
<image>imag2</image>
<url>http://www.blabla2.com</url>
</poi>
<poi>
<description>bla bla3</description>
<image>imag3</image>
<url>http://www.blabla3.com</url>
</poi>
I came up with some code from the apple documentation
(http://developer.apple.com/documentation/Cocoa/Conceptual/XMLParsing/XMLParsing.html#//apple_ref/doc/uid/10000186),
but somehow only the first poi is processed. There are no errors or
warnings in the code.
Thanks in advance!
You can also validate an XML document before parsing it use the methods
in NSXML and its subsclasses. There's also an option in NSXML to tidy
XML documents in case they are malformed.
Mike
_______________________________________________
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