Re: what is the correct for xpath selector for xsi:type

trubliphone <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
I think that this is a namespace issue.  You will need to register the 
"xsi" namespace to the libXML2 engine and then use its prefix in your 
XPath expressions.

The way to do that varies by language.



On 12/08/2011 06:08 PM, Andy Davidson wrote:
> Hi
>
> I am trying use libxml2 to parse the following xml.
>
> <?xmlversion="1.0"encoding="UTF-8"?>
> <zoo:cageRequest
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:zoo="http://www.example.org/Zoo"
> xsi:schemaLocation="http://www.example.org/Zoo ../XSD/ZooRequest.xsd ">
> <animalxsi:type="zoo:Fish">
> <name>tuna</name>
> <numberOfFins>4</numberOfFins>
> </animal>
> </zoo:cageRequest>
>
> I need to do some special processing based on the value of xsi:type. 
>  I eventual get a a xmlNodePtr that points to
>
> <animalxsi:type="zoo:Fish">
> <name>tuna</name>
> <numberOfFins>4</numberOfFins>
> </animal>
>
> I can not seem to select the attribute. "@*" works but is not going to 
> work long term.
>
> "@xsi:type" and "@type" did not work
>
> thanks
>
> Andy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.