Re: Accessing attributes of XML (Christian Graus)

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 10:55 AM, Richard Wolf <[EMAIL PROTECTED]> wrote: > > On May 5, 2008, at 6:49 PM, [EMAIL PROTECTED] wrote: > > I had to pick up the XPath stuff recently for a project I was working > > > on, and I've got to say that once you get yourself thinking in that > > > way, it's rea

Re: Accessing attributes of XML (Christian Graus)

2008-05-05 Thread Richard Wolf
On May 5, 2008, at 6:49 PM, [EMAIL PROTECTED] wrote: I had to pick up the XPath stuff recently for a project I was working on, and I've got to say that once you get yourself thinking in that way, it's really very nice for inspecting XML files, giving you great, readable control for grabbing

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
Hi Jens I just wanted to let you know, I fixed my various changes as per your recommendations ( getting back to the code I started with ) and figured out how/where to use po, and sure enough, my code was working all along, I just expected the info I got when I hovered the mouse over a variable to

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 9:00 AM, David Wilson <[EMAIL PROTECTED]> wrote: > On Mon, May 5, 2008 at 6:36 PM, Christian Graus > <[EMAIL PROTECTED]> wrote: > > Yeah, that's where I found the docs. IMHO it's a real shame that a > proper > > DOM implimentation is not available as standard. I am famil

Re: Accessing attributes of XML

2008-05-05 Thread David Wilson
On Mon, May 5, 2008 at 6:36 PM, Christian Graus <[EMAIL PROTECTED]> wrote: > Yeah, that's where I found the docs. IMHO it's a real shame that a proper > DOM implimentation is not available as standard. I am familiar with XQuery, > but I've never known anyone to use it, perhaps it's used more o

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 8:44 AM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 5 May '08, at 3:36 PM, Christian Graus wrote: > > OK - thanks. I will try that. My reading had me thinking that > > NSXMLElement and NSXMLDocument are both derived from NSXMLNode, and that > > anyting bar the root was

Re: Accessing attributes of XML

2008-05-05 Thread Jens Alfke
On 5 May '08, at 3:36 PM, Christian Graus wrote: OK - thanks. I will try that. My reading had me thinking that NSXMLElement and NSXMLDocument are both derived from NSXMLNode, and that anyting bar the root was an NSXMLElement, with methods returning NSXMLNode as a base class to all nodes.

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 8:27 AM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 5 May '08, at 2:30 PM, Christian Graus wrote: > > As for NSMXLNode, I moved to NSXMLElement to get access to > > attributeForName, I was using NSXMLNode before that, still to no avail. > > > > No, I meant to change this

Re: Accessing attributes of XML

2008-05-05 Thread Jens Alfke
On 5 May '08, at 2:30 PM, Christian Graus wrote: As for NSMXLNode, I moved to NSXMLElement to get access to attributeForName, I was using NSXMLNode before that, still to no avail. No, I meant to change this line: NSXMLElement *name = [node2 attributeForName:@"Name"]; That should be

Re: Accessing attributes of XML

2008-05-05 Thread Christian Graus
On Tue, May 6, 2008 at 2:28 AM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 5 May '08, at 5:34 AM, Christian Graus wrote: > > NSXMLElement *node2 = [array objectAtIndex:nodeCount]; > > > > NSXMLElement *name = [node2 attributeForName:@"Name"]; > > > > 'name' should be declared as NSXMLNode*, or

Re: Accessing attributes of XML

2008-05-05 Thread Jens Alfke
On 5 May '08, at 5:34 AM, Christian Graus wrote: NSXMLElement *node2 = [array objectAtIndex:nodeCount]; NSXMLElement *name = [node2 attributeForName:@"Name"]; 'name' should be declared as NSXMLNode*, or you'll get a compiler type- mismatch warning. (But that doesn't explain why its -string

Accessing attributes of XML

2008-05-05 Thread Christian Graus
Hi, I have the following code: NSXMLDocument *doc = [[NSXMLDocument alloc] initWithContentsOfURL:xmlURL options:0 error:&error]; NSXMLNode *node = [doc rootElement]; NSArray *array = [node nodesForXPath:@"/DiaIndex/Item" error:&err]; int nodeCount = 0; while(nodeCount