W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2011

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

From: trubliphone <trubliphone@gmail.com>
Date: Fri, 09 Dec 2011 08:55:58 -0700
Message-ID: <4EE22F8E.2080403@gmail.com>
To: xmlschema-dev@w3.org
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
Received on Monday, 12 December 2011 12:32:09 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:19 UTC