[xslt] Why doesn't xsltproc generate an xml:base attribute when xinclude href isjust a filename?



In the following example, xsltproc (from libxslt-1.1.6) does not generate
an xml:base attribute on the XML element included via an XInclude element:

file mydir/xincludeTest.xml:
<?xml version="1.0"?>
<Test xmlns:xi="http://www.w3.org/2003/XInclude";>
  <xi:include href="xincludeTest2.xml"/>
  <Test/>
</Test>

file mydir/xincludeTest2.xml (in the same directory as xincludeTest.xml.)
<?xml version="1.0"?>
<Test>
  Hello
</Test>

xsltproc --xinclude simpleStylesheet.xml xincludeTest.xml
<?xml version="1.0"?>
<Test xmlns:xi="http://www.w3.org/2003/XInclude";>
  <Test>
  Hello
</Test>
  <Test/>
</Test>

However, if I change the href in the XInclude element to be a relative file
path, as below, xsltproc generates the xml:base attribute:
<?xml version="1.0"?>
<Test xmlns:xi="http://www.w3.org/2003/XInclude";>
  <xi:include href="../mydir/xincludeTest2.xml"/>
  <Test/>
</Test>

xsltproc --xinclude simpleStylesheet.xml xincludeTest.xml
<?xml version="1.0"?>
<Test xmlns:xi="http://www.w3.org/2003/XInclude";>
  <Test xml:base="../mydir/xincludeTest2.xml">
  Hello
</Test>
  <Test/>
</Test>

Having read the XInclude draft recommendation, it's still not clear to me
exactly when the xml:base attribute is guaranteed to be generated, but it
seems reasonable to expect it to be generated when the href is a simple
filename. Can anyone explain why xsltproc does not do this?



-----------------------------------------
This message and its attachments may contain  privileged and confidential information.  If you are not the intended recipient(s), you are prohibited from printing, forwarding, saving or copying this email.  If you have received this e-mail in error, please immediately notify the sender and delete this e-mail and its attachments from your computer.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]