RE: [docbook-apps] xml:base and DocBook stylesheets

From
Mauritz Jeanson <>
Date
2006-10-04T16:19:54+00:00
ID
008d01c6e7d0$e8577f60$71ea1a51@D7MZ171J
Thread
RE: [docbook-apps] xml:base and DocBook stylesheets
> -----Original Message-----
> From: Bob Stayton 
> In 1.70.1, Norm added a template named 'add-xml-base' to to 
> common/stripns.xsl do that.  That template is called only 
> when processing a 
> DocBook 5 document because it gets put into a nodeset before 
> applying the 
> regular templates.  But there is no standard function in XSLT 1.0 for 
> identifying the xml:base of the current document. However, 
> there is a Saxon 
> extension function saxon:systemId that can do that.  So 
> add-xml-base checks 
> to see if that function exists, and if it does, it computes 
> the xml:base of 
> the document and adds that attribute to the root element in 
> the internal 
> nodeset. 


Perhaps a warning message should be emitted if you don't use Saxon. 

It is possible to add support for Xalan-Java, which has a systemId extension
function too. The function can be used in a stylesheet like this:

 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:NodeInfo="org.apache.xalan.lib.NodeInfo">
   ...
   <xsl:value-of select="NodeInfo:systemId()"/>

See http://xml.apache.org/xalan-j/extensionslib.html#nodeinfo.

/MJ