cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19423] - XPointer implementation in XInclude Transformer is broken
Date Tue, 13 May 2003 09:26:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19423>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19423

XPointer implementation in XInclude Transformer is broken

tschlabach@gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED



------- Additional Comments From tschlabach@gmx.net  2003-05-13 09:26 -------
After some research, I need to be a bit more specific here.
It is important to distinguish XPointer (see
http://www.w3.org/TR/xptr-framework/) from XPath (http://www.w3.org/TR/xpath)
and/or the very recent XPath 2.0 working draft (http://www.w3.org/TR/xpath20/).

To make a long story short: While XPath "is a language for addressing parts of
an XML document" (which implies that it has already been made clear which
document the XPath expression applies to) XPointer "an extensible system for XML
addressing [...] intended to be used as a basis for fragment identifiers for any
resource whose Internet media type is one of text/xml, application/xml,
text/xml-external-parsed-entity, or application/xml-external-parsed-entity" (or
in other Words: XPointer is a sort of URI that references a fraction of a
document while also including which document to take a fraction out of).

Another way of seeing this is: Getting some XML fragment just by an XPath is
about as saying "give me lines 10-15" in a text file. You need to know what file
and probably other things as well. XPointer by contrast is like "give me lines
10-15 of file foo.txt".

The cocoon XIncludeTransforder claims to use XPointer but omits the namespace
portion of the XPointer Framework (see 3.4 in the W3C document). This renders it
impossible to use with any documents using namespaces because there is no way to
map prefix to namespace in the XPointer expression because the current code
extracts anyhting before the # as the filename and just takes the XPath
exporession for the xpointer(...) part but ignores and xmlns(abc=http://foo")
assignments.

As "no namespace" is not identical to "default namespace" you will fail trying
to extract /html/body/ from an XHTML document as it usually declares
http://www.w3.org/1999/xhtml the default namespace in the XML root element
(html): <html xmlns="http://www.w3.org/1999/xhtml">

Xalan-J has no problems getting this right but it needs some extra code as it
has no XPointer implementation but just an XPath implementation and some means
to make it handle namespaces correctly. But: No changes to Xalan-J necessary.

What makes it a bit more complex to fix this bug is the fact the that Cocoon
XIncludeTransformer does not call Xalan-J directly but uses and Avalon component
that seems to be unaware of this issues as well.

Therefore the question will be:

1. Fix it in Avalon.
2. Make Cocoon use the fixed Avalon component

or

3. Skip Avalon (I am not sure where the value-add will be in using it) and
modifiy Cocoon XIncludeTransformer in a way it calls Xalan directly and will
full namespace support.

Mime
View raw message