jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • jaxen
  • JAXEN-39

Entity handling for DOM Navigator

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0
  • Fix Version/s: 1.2
  • Component/s: dom
  • Labels:
    None

Description

migrated issue from sourceforge

Hi all,

Please find attached a patch that allows the org.jaxen.dom.DocumentNavigator class to handle entity references.

Entity references are tricky to deal with using the W3C DOM model, since they involve a degress of travesing up and down when looking for nodes that XPath sees as being at the same depth in the tree.

As a consequence the code is not as clean as the original DOM implementation. In fact, you'll see a fair degree of redundancy in getChildAxisIterator and getFollowingSiblingAxisIterator. In fact getPrecedingAxisIterator follows a very similar pattern as well.

I've done some basic testing of the code against DOM 1 (though I see no reason why DOM 2 wouldn't work just as well). I guess you'll be after some test cases at some point as well.

The code is patched against the 1.0-beta-7 release, though a quick look at CVS doesn't show any more recent changes to the DocumentNavigator.

I'm subscribed to the mailing list, so if you have any questions, I'll be listening there.

Cheers,

Nicholas Cull
run2000@users.sourceforge.net

Mea culpa!

I ran my original patch through the JUnit tests, and spotted
a problem with the parent axis iterator. The newer patch
fixes this by testing for null before trying to test the
parent node's type.

The new patch now passes all the existing test cases on the
DOM model. I'll see if I can construct some simple tests
that show that entity references actually work correctly for
DOM shortly. I'll have difficulty making these generic
though, since some of the other XML models will surely have
the same problems that the DOM navigator had with entity
handling.

Cheers,

Nicholas Cull
run2000@users.sourceforge.net

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    DocumentNavigator.patch
    15/Sep/04 3:30 PM
    6 kB
    Brian Ewins

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brian Ewins added a comment - 15/Sep/04 3:30 PM

"Better factored patch that still works (v4)" (patch was to 1.0.b7)

Show
Brian Ewins added a comment - 15/Sep/04 3:30 PM "Better factored patch that still works (v4)" (patch was to 1.0.b7)

People

  • Assignee:
    Unassigned
    Reporter:
    Brian Ewins
Vote (0)
Watch (0)

Dates

  • Created:
    15/Sep/04 3:28 PM
    Updated:
    20/Feb/05 11:42 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.