Unable to strip the namespace from DB5 document, cannot proceed Error at xsl:message on line 162 of docbook.xsl:

StackOverflow https://stackoverflow.com/questions/16563607

  •  29-05-2022
  •  | 
  •  

Question

I am trying to use xsltproc on windows and xi:include in my docbook 5 document rather than entities.

Unfortunately the windows version does not support this.

Saxon 9.6 and msxsl both report the error:

Unable to strip the namespace from DB5 document, cannot proceed Error at xsl:message on line 162 of docbook.xsl:

I have included

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:d="http://docbook.org/ns/docbook" 
exclude-result-prefixes="d">

in my customisation xsl.

Is there anything else I should be doing?

I have edited my customisation stylesheet to

<?xml version='1.0'?>

<xsl:import href="file:///C:/docbook/docbook-xsl-ns-1.78.1/fo/docbook.xsl"/>

and use the command

>C:\docbook\Saxonica\SaxonHE9.5N\bin\transform  -xi -xsl:my_fo.xsl  -s:my_db.xml

should this now work?

Was it helpful?

Solution

Neither the HE version of Saxon 9.5 (there is no 9.6 yet) nor msxsl supports the exsl:node-set() extension (which is required when removing the namespace). Saxon 9 is an XSLT 2.0 processor which basically means that this extension function is not needed (see also http://www.saxonica.com/documentation/html/extensions/functions/exslt.html). For msxsl, you would need an additional download (see http://www.xml.com/pub/a/2003/08/06/exslt.html).

It should work with Saxon 6.5.5 or xsltproc (XSLT 1.0 processors).

From the error message I see that you are using the non-namespace-aware stylesheets. Since this is about processing DocBook 5, I advice you to switch to the namespace-aware stylesheets (docbook-xsl-ns, available from http://sourceforge.net/projects/docbook/files/docbook-xsl-ns/). Then there will be no need for any namespace-stripping.

You also mention using xi:include. Any problems with XInclude are probably unrelated to the namespace-stripping issue. I am not sure what you mean by "this" when you say "the windows version does not support this".

See also:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top