Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: XML Parsing (2)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML Parsing (2)



If NSXMLParser is as useless to you as it is to me, then try using the libxml2 libraries it's based on. As long as you're not afraid of plain C code, <http://www.xmlsoft.org/> has terrific examples and documentation on how to use it.

- Justin Anderson

On Nov 12, 2003, at 12:08 AM, Dennis Falling wrote:

I've spent the past two days trying to find well-documented XML parsers
for Cocoa but haven't had much luck.  I appreciate the suggestions from
those on this list, but I just can't figure out any of them...  I've
looked at NSXMLParser, XMLTree, Iconara DOM, and CFXMLParser.

Basically, I need to parse an XML file and grab some values from it to
create my data.  If an example file would help, try
http://www.csc.tntech.edu/~dat/courses/4240/bn.xml (best viewed in
Firebird- it displays the document tree.)

Java has something similar to what I want (but I don't want java :-( )

NodeList nodes = doc.getElementsByTagName("tag");
          for (int i = 0; i < nodes.getLength(); i++) {
             Element element = (Element) nodes.item(i);

I want a way to get all nodes matching some criteria as above, and then
the ability to query each node for it's values.  If I could ask the
nodes something along the lines of "valueForTagName("prob")" I think
I'd be set.

Thanks for all help- I'm getting really frustrated at the seeming lack
of documentation.
-dfalling
_______________________________________________
studentdev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/studentdev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
studentdev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/studentdev
Do not post admin requests to the list. They will be ignored.

References: 
 >XML Parsing (2) (From: Dennis Falling <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.