Project

Profile

Help

Best/Recommended way to make an XdmItem

Added by Anonymous over 16 years ago

Legacy ID: #4893351 Legacy Poster: David Lee (daldei)

What is the best or recommended way of constructing an XdmItem representing an atomic type from a String or int. I tried using XdmItem.newAtomicValue( "string" , XdmItem.ANY_ATOMIC_VALUE ) but its crashing on me (stack trace on request). Before I dig into this further, is there another "obvious" way to create atomic values as XdmItems ? Thanks ! David Lee


Replies (2)

RE: Best/Recommended way to make an XdmItem - Added by Anonymous over 16 years ago

Legacy ID: #4894105 Legacy Poster: Michael Kay (mhkay)

The class XdmAtomicValue has a number of constructors, one of which makes it easy to construct an xs:string value. The factory method newAtomicValue() was in fact an experiment that got left in the code by mistake, and therefore wasn't tested. The reason it crashes is that ANY_ATOMIC_VALUE is an abstract type and can't be instantiated; to create a string this way, you would need to use an ItemType representing xs:string. The crash has been reported before and is fixed in the source but I haven't got around to issueing a patch yet.

RE: Best/Recommended way to make an XdmItem - Added by Anonymous over 16 years ago

Legacy ID: #4895588 Legacy Poster: David Lee (daldei)

Works perfectly ! thank you !

    (1-2/2)

    Please register to reply