santuario-dev mailing list archives

DO NOT REPLY [Bug 42599] - Integration of a full-featured XPointer resource resolver.

Date

Wed, 06 Jun 2007 20:18:50 GMT

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42599>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42599
------- Additional Comments From putmanb@georgetown.edu 2007-06-06 13:18 -------
Regarding the ID resolution issue: something similar came up on the dev list
recently. If it really needs to work without schema validation, I think the
only option (short of implementing your own ID resolver, and it's not even clear
how that would work) is for the calling code to first pre-process the DOM
Document using knowledge of the content model, and find and mark/register the
ID's so they can be resolved.
If you want to assume DOM Level 3 support then the Attr nodes can be marked as
an ID type with the Element#setID* methods. (This is what we do in OpenSAML
when we marshall to and unmarshall from the DOM model to our object provider model.)
If not, then you could register them manually with the Apache xmlsec library's
IDResolver. In org.apache.xml.security.utils.IdResolver, see:
IdResolver#registerElementById(Element, Attr)
IdResolver#registerElementById(Element, String)
Either way, you probably want to use the Apache IDResolver in your code here,
since it just delegates to Document#getElementById anyway:
// plain ID reference.
if (i==0 && !parts[i].startsWith(XP_OPEN))
{
node = this.baseNode.getOwnerDocument().getElementById(parts[i]);
}
If you're saying the javax.xml.xpath.XPath engine is hardcoded to use
Document#getElementByID internally, and doesn't have any way to modify how ID
resolution works (e.g. ID resolver plugin, etc), then I guess you're stuck with
marking the Attr nodes as ID types (and limited to DOM Level 3 environments).
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.