Hi,
Are XSI types supported within the XML Path Reader?
Thanks
Mike
Are XSI types supported within the XML Path Reader?
Thanks
Mike
-
Hi, namespaces are supported by the XML Path Reader.
An examaple:
<xml xmlns:xsi="http://www.xxx.org/p/">
<test xsi:type="a:IntlAddress">test data</test>
</xml>
<Context xpath="/xml" outPort="0" namespacePaths="xsi='http://www.xxx.org/p/'">
<Mapping xpath="test/@xsi:type" cloverField="xsiData"/>
</Context> -
Thanks for your answer.
I am having problems getting this example to work.
I am using...
<OLife xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Party xsi:type="Person">
<ID>Person_0</ID>
</Party>
</OLife>
with...
<Context xpath="/OLife" namespacePaths="xmlns='http://stanlib.com/services/1.0/'">
<Context xpath="Party/@xsi:type=Person" outPort="0">
<Mapping nodeName="ID" cloverField="id" />
</Context>
</Context>
But get the following error ...
Reason: net.sf.saxon.trans.StaticError: XPath syntax error at char 15 in {Party/@xsi:type=Person}:
Prefix xsi has not been declared
XML_XPATH_READER0 ...FAILED !
Any ideas what I am doing wrong. Thanks for your help. -
Sorry had a moment there.
Notice I havent specified the namespaces. -
Hi,
I am still seem to be having a few problems getting this to work.
Can you spot anything I am doing wrong?
<OLife xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Mike.com/services/1.0/">
<Party xsi:type="Person">
<ID>Person_0</ID>
</Party>
</OLife>
<Context xpath="/OLife" outPort="0" namespacePaths="xsi='http://www.w3.org/2001/XMLSchema-instance';xsd='http://www.w3.org/2001/XMLSchema';xmlns='http://mike.com/services/1.0/'">
<Mapping xpath="/Party/@xsi:type=Person/ID" cloverField="id"/>
<Context xpath="Party/@xsi:type=Person" outPort="1" SequenceField="id">
<Mapping xpath="ID" cloverField="id"/>
</Context>
</Context>
Thanks for your help. -
Hi,
This mapping will work...
<Context xpath="/OLife" outPort="0" namespacePaths="xsi='http://www.w3.org/2001/XMLSchema-instance';xsd='http://www.w3.org/2001/XMLSchema';xmlns='http://Mike.com/services/1.0/'">
<Context xpath="Party" outPort="1" namespacePaths="xsi='http://www.w3.org/2001/XMLSchema-instance';xsd='http://www.w3.org/2001/XMLSchema';xmlns='http://Mike.com/services/1.0/'">
<Mapping xpath="ID" cloverField="id"/>
</Context>
</Context>
with this xml...
<OLife>
<Party>
<ID>Person_2</ID>
</Party>
</OLife>
but when I use this...
<Context xpath="/OLife" outPort="0" namespacePaths="xsi='http://www.w3.org/2001/XMLSchema-instance';xsd='http://www.w3.org/2001/XMLSchema';xmlns='http://mike.com/services/1.0/'">
<Context xpath="Party/@xsi:type" outPort="1" namespacePaths="xsi='http://www.w3.org/2001/XMLSchema-instance';xsd='http://www.w3.org/2001/XMLSchema';xmlns='http://mike.com/services/1.0/'">
<Mapping xpath="ID" cloverField="id"/>
</Context>
</Context>
with this xml...
<OLife xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://mike.com/services/1.0/">
<Party xsi:type="Person">
<ID>Person_0</ID>
</Party>
</OLife>
It doesnt seem to work with the xsi type.
Any ideas? -
Try this:
<Context xpath="/OLife" outPort="0" namespacePaths="'http://mike.com/services/1.0/';xsi='http://www.w3.org/2001/XMLSchema-instance';xsd='http://www.w3.org/2001/XMLSchema'">
<Context xpath="Party" outPort="1">
<Mapping xpath="ID" cloverField="id"/>
<Mapping xpath="matches(@xsi:type,'Person')" cloverField="isPerson"/>
</Context>
</Context>
Two points:
1) The context may not return true/false. But it would be nice feature..
2) Key sensitive is important for 'http://mike.com/services/1.0/' -
Thanks. That last one worked.
Thanks for your help.
M
Please sign in to leave a comment.
Comments 7