• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSXMLElement & Xpath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSXMLElement & Xpath


  • Subject: NSXMLElement & Xpath
  • From: Alexander Griekspoor <email@hidden>
  • Date: Thu, 6 Dec 2007 00:26:48 +0000

Hi,

I bet a trivial question for experts but I couldn't find an answer nevertheless. Given the following NSXML fragment:

<author>
<name>G. G. Kacprzak</name>
<arxiv:affiliation xmlns:arxiv="http://arxiv.org/schemas/ atom">NMSU</arxiv:affiliation>
</author>


With the XPath query: /author[1]/name[1] I correctly get the name element
With the XPath query: /author[1]/arxiv:affiliation[1] I expect to get the arxiv:affiliation element


However, the latter won't work, even though if I ask the rootelement for its 2nd child and ask for its XPath, I do get /author[1]/ arxiv:affiliation[1] !!
The XQuery error I get returned says: can't resolve QName for "arxiv:affiliation"


Can anyone tell me how to format the xpath or escape it such that I get the element by its name?
I simply want to be able to do: [[xmlDoc rootElement] nodesForXPath: @"//arxiv:affiliation" error: err]


Thanks!
Alex

**********************************************
         ** Alexander Griekspoor  PhD **
**********************************************
          mekentosj.com

 Papers - Your Personal Library of Science
 2007 Winner of the Apple Design Awards
         Best Mac OS X Scientific Solution
         http://www.mekentosj.com/papers
**********************************************

_______________________________________________

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


  • Follow-Ups:
    • Re: NSXMLElement & Xpath
      • From: Alastair Houghton <email@hidden>
    • Re: NSXMLElement & Xpath
      • From: Rob Keniger <email@hidden>
  • Prev by Date: New York CocoaHeads - Thursday, Dec. 13
  • Next by Date: Re: Canonical way of loading compound UI components from a NIB into some other UI?
  • Previous by thread: New York CocoaHeads - Thursday, Dec. 13
  • Next by thread: Re: NSXMLElement & Xpath
  • Index(es):
    • Date
    • Thread