Project

Profile

Help

.net/Saxon.Api: How to create a XdmValue of type xs:untypedAtomic?

Added by Stefan Krause over 6 years ago

Perhaps I have overseen the obviuos, but: how can I create a @XdmValue@ with type @xs:untypedAtomic@?

My workaround for now is


xPathCompiler.Evaluate("xs:untypedAtomic('" + entry.Value + "')", null)

but this will fail if @entry.Value@ contains one or more apostrophs.

Thanks for your help,

Stefan


Replies (3)

Please register to reply

RE: .net/Saxon.Api: How to create a XdmValue of type xs:untypedAtomic? - Added by Michael Kay over 6 years ago

Try:

new XdmAtomicValue("string", ItemType.UNTYPED_ATOMIC);

RE: .net/Saxon.Api: How to create a XdmValue of type xs:untypedAtomic? - Added by Stefan Krause over 6 years ago

Thank your for the hint. This works for me:


XdmValue untypedAtomic = new XdmAtomicValue(entry.Value, QName.XDT_UNTYPED_ATOMIC, processor);
    (1-3/3)

    Please register to reply