Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-366

Apache JXPath support

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • Version 2.3.1
    • None
    • XPath
    • None

    Description

      I have patched the version 2.3 to support Apache JXPath when no saxon is found (default behavior), I sent this to the dev mailing list without answer, so I an adding it here to see if it gets a little more attention (I can update it to trunk and make the necessary changes):

      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 implementation 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

      Attachments

        1. jxpath-support.patch
          28 kB
          Robert Marcano

        Activity

          People

            Unassigned Unassigned
            robmv Robert Marcano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: