You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Robert Marcano <ro...@marcanoonline.com> on 2008/02/28 21:04:51 UTC

JXPath support

Greeting everyone, I have been a long time user of XMlBeans but it is
the first time I needed to use the XPath support. Using an old Saxon
release (8.6.1 as documented because is the version that is API
compatible) everything is working perfectly.

My application is Webstart based so I try to reduce the amount of
external dependencies in order to have a small download size, I am
currently using JXPath for some Beans trees searches, so I decided to
patch XMLBeans to try to use JXPath after it fails to find Saxon. I am
attaching the patch so anyone can use it and to know if the changes are
accepted so I can port it to the trunk release instead of 2.3.0.

In the process of developing this patch I found one problem with the
XPath function "id()". The JXPath implemetation of this functions when
it is traversing a DOM tree is to find the document owner and call
getElementById(). the current DOM implementation of XMLBeans only
recognize ID attributes when they are defined on a DTD and does not use
the XML schema information. Even when my XMLBeans model parses a DOM
tree obtained from a XML Schema validating DOM parser, the ID attributes
information is lost because it recreated an internal tree that discards
the "isId" information added by the DOM parser. I tried to use the
schema type information in the method Cur>>isAttrOfTypeId but still do
not find a way, any helps with this is appreciated

--
Robert Marcano