Re: xml parsing

2008-06-13 Thread Mike Manzano

Try posting some code.

On Jun 13, 2008, at 1: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
descriptionbla bla/description
imageimag1/image
urlhttp://www.blabla.com/url
/poi
poi
descriptionbla bla2/description
imageimag2/image
urlhttp://www.blabla2.com/url
/poi
poi
descriptionbla bla3/description
imageimag3/image
urlhttp://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/1186), but somehow only the first poi is  
processed. There are no errors or warnings in the code.


Thanks in advance!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/mike%40instantvoodoomagic.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: xml parsing

2008-06-13 Thread Steve Majewski


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
descriptionbla bla/description
imageimag1/image
urlhttp://www.blabla.com/url
/poi
poi
descriptionbla bla2/description
imageimag2/image
urlhttp://www.blabla2.com/url
/poi
poi
descriptionbla bla3/description
imageimag3/image
urlhttp://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/1186), but somehow only the first poi is  
processed. There are no errors or warnings in the code.


Thanks in advance!

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: xml parsing

2008-06-13 Thread Mike

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
descriptionbla bla/description
imageimag1/image
urlhttp://www.blabla.com/url
/poi
poi
descriptionbla bla2/description
imageimag2/image
urlhttp://www.blabla2.com/url
/poi
poi
descriptionbla bla3/description
imageimag3/image
urlhttp://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/1186), 
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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]