[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Unwanted xmlns="" inserted by xsl-ns customization layer
On 11/04/2013 08:55 PM, Alexey Neyman wrote:
Not exactly. The namespaces in XML are identified by URI, not by prefix. In other words, the same prefix (an empty prefix in your case) can refer to different URIs in different XML documents. Thus, the stylesheet you're customizing declares empty (default) namespace prefix to point to http://www.w3.org/1999/xhtml URI. When you add a customization layer, you didn't specify the prefix for the default namespace, so XSLT processor assumed the <script/> element belongs to a namespace with no URI. As its parent element had default namespace pointing to a different URI, it redeclared the default namespace for <script/> to an empty string. You can add the xmlns="http://www.w3.org/1999/xhtml" declaration to the <xsl:stylesheet/> element in your customization layer to avoid declaring it on each element.
Thanks, Alexey. That helps simplify the XSL I'm writing and also helps in getting my head around this stuff after about a 6 year gap. Jon Leech