Re: [xml-dev] Re: I can XInclude where I bloody want to

From
Elliotte Rusty Harold <>
To
Uche Ogbuji <>
Date
2002-04-30T12:12:07Z
ID
<p04330102b8f434b25626@[192.168.254.4]>
Thread
Re: [xml-dev] Re: I can XInclude where I bloody want to
At 9:47 PM -0600 4/29/02, Uche Ogbuji wrote:


>>From my point of view, you don't even have an argument, let alone a 
>>good one.  It seems that you think that because XSLT mentions XPath 
>>and that XPath mentions XML 1.0 that this somehow translates into 
>>"An XSLT processor may not perform any operations that are not 
>>explicitly specified in XSLT 1.0, XPath 1.0 and XML 1.0 
>>recommendations".  I think this is silly.  By your reasoning, for 
>>instance, an XSLT processor would not be able to use xml:base to 
>>affect the resolution of relative xsl:import and xsl:include 
>>instructions, document(), etc.
>

I'm a little baffled myself. Do you really believe that any operation 
that is not specifically forbidden is permitted? For instance, is it 
OK for an XSLT processor to replace all rectangle elements with 
circle elements when forming the source tree? If not, why is this 
case any different than replacing all xi:include elements with the 
contents of their referenced documents?

(For the record, I do think the XSLT spec is quite clear that any 
preprocessing of the sort you suggest is specifically forbidden, but 
if it's not, how do you then draw any line between forbidden and 
permitted preprocessing? )

>So let me ask you: do you say that XML Base is also forbidden in 
>XSLT processing?

That's a horse of a different color. XML Base processing does not 
change the document that's presented to an XSLT processor. Whether 
you consider xml:base to have some special semantics or just to be an 
attribute named xml:base, the source tree presented to the XSLT 
processor is the same. Thus xml:base really has no impact whatsoever 
on the interpretation of other data in the input document.

Using xml:base in a stylesheet would be a little different. Adding an 
xml:base attribute to an xsl:stylesheet element would be legal 
because, "An element from the XSLT namespace may have any attribute 
not from the XSLT namespace, provided that the expanded-name of the 
attribute has a non-null namespace URI. The presence of such 
attributes must not change the behavior of XSLT elements and 
functions defined in this document. Thus, an XSLT processor is always 
free to ignore such attributes, and must ignore such attributes 
without giving an error if it does not recognize the namespace URI." 
Thus even though, an xml:base attribute is permitted, using xml:base 
to interpret relative URLs passed to the document() function would be 
a clear violation of XSLT 1.0.

The XML Base spec states:

The deployment of XML Base is through normative reference by new 
specifications, for example XLink and the XML Infoset. Applications 
and specifications built upon these new technologies will natively 
support XML Base. The behavior of xml:base attributes in applications 
based on specifications that do not have direct or indirect normative 
reference to XML Base is undefined.

In other words, XML Base is clearly not intended to apply 
retroactively to old specs like XSLT 1.0.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold |  | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+