[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Unwanted xmlns="" inserted by xsl-ns customization layer
I'm attempting to customize http://docbook.sourceforge.net/release/xsl-ns/current/xhtml5/onechunk.xsl to insert MathJax <script> elements in the <head> of my output documents, by defining the user.head.content template to include my <script> elements: <xsl:template name="user.head.content" exclude-result-prefixes=""> <script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> </xsl:template> This does output the <script> tags when put through xsltproc (and also echoes part of the generated document to stdout for reasons I'm unclear on, but that's a separate weird thing). The problem is that it also adds an unwanted xmlns="" attribute in the output elements: <script xmlns="" type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script xmlns="" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"/> The xmlns="" then prevents the MathJax scripts from executing correctly. I am trying to figure out how to suppress it. Adding exclude-result-prefixes="" to the <xsl:stylesheet> element of my customization layer changes nothing. This kind of makes sense, since the attribute says it takes a whitespace-separated list of names, while the name I'm trying to suppress is the empty string. But that seems to be the extent of the control available over namespaces in the output, so I'm at a loss now. I've attached a test document and stylesheet that behave as described when run with the xsl-ns stylesheets rev 1.78.1 and xsltproc --nonet --xinclude test.xsl test.db I'm guessing I've run into some sort of conceptual misunderstanding of how XSLT treats namespaces, but haven't been able to find the right documentation to clear it up, yet. Thanks, Jon Leech
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="test"> <refmeta> <refentrytitle>gltest</refentrytitle> <manvolnum>3G</manvolnum> </refmeta> <refnamediv> <refname>gltest</refname> <refpurpose>set the viewport</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>glTest</function></funcdef> <paramdef>GLint <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> </refentry>
Attachment:
test.xsl
Description: application/xslt
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]