XdmNode to Item ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

XdmNode to Item ?

cmarchand

 

 

Hello,

 

what's the way to wrap a net.sf.saxon.s9api.XdmNode to an net.sf.saxon.om.Item ? I have to build a sequence of XdmNode...

 

Thanks in advance,

Christophe


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XdmNode to Item ?

Michael Kay
If the net.sf.saxon.om.Item is a NodeInfo, use

new XdmNode((NodeInfo)item)

If it isn't, then you shouldn't be attempting it!

If you've got a sequence of nodes, then you could also do something like

XdmValue val = new XdmValue(sequence);
for (XdmItem item : val) {
   XdmNode node = (XdmNode)item;
    ...
}


On 19 Nov 2015, at 13:32, [hidden email] wrote:

 
 

Hello,

 

what's the way to wrap a net.sf.saxon.s9api.XdmNode to an net.sf.saxon.om.Item ? I have to build a sequence of XdmNode...

 

Thanks in advance,

Christophe

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: XdmNode to Item ?

cmarchand
Thanks a lot !
Christophe

Le 19/11/2015 19:39, Michael Kay a écrit :
If the net.sf.saxon.om.Item is a NodeInfo, use

new XdmNode((NodeInfo)item)

If it isn't, then you shouldn't be attempting it!

If you've got a sequence of nodes, then you could also do something like

XdmValue val = new XdmValue(sequence);
for (XdmItem item : val) {
   XdmNode node = (XdmNode)item;
    ...
}


On 19 Nov 2015, at 13:32, [hidden email] wrote:

 
 

Hello,

 

what's the way to wrap a net.sf.saxon.s9api.XdmNode to an net.sf.saxon.om.Item ? I have to build a sequence of XdmNode...

 

Thanks in advance,

Christophe

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help