Hi all,
   The XML Schema 1.1 specification requires us to have a typed XDM
instance, for assertions XPath 2.0 processing. By typed, I mean the
nodes in the XDM instance rooted at some element, need to acquite the
type annotations from the Schema under processing.

Presently, I am constructing a DOM (rooted at an element, whose Schema
type has assertions) from XNI events. I then supply this DOM to the
XPath 2.0 engine directly. The XPath 2.0 engine I think internally
maps this DOM to the XPath data model and executes the XPath 2.0
expressions on it.

The DOM that I construct at present is untyped, and as a consequence,
the XPath 2.0 engine doesn't have type information from the original
schema. This doesn't allow some type aware operations (like using
XPath 2.0 'le' operator) to be possible directly. As a workaround, we
have to do explicit type casting (like, "xs:int(@min) le
xs:int(@max)") for some operations to succeed.

I think, with psychopath XPath 2.0 engine, we might be able to solve
this problem, as it is schema aware and is compatible to Xerces-J.

But with Saxon basic, I find difficult to implement schema awareness
of the XDM instance.

I think, to provide type information to the XPath 2.0 engine, we can
use the Xerces Augmentations object available in XNI methods, in
XMLSchemaValidator. I think, I can build a tree (for e.g., a DOM tree
which has PSVI information) or generate a SAX stream with PSVI
information. But I think, Saxon doesn't support Xerces PSVI model.

Could somebody please share an implementation strategy to implement
type awareness for XPath 2.0 processing in assertions.


-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to