I'm making my first steps with XSLT and run into a problem where I didn't find an explanation yet for. Have a look at this very simple XML document (DocBook) ...
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="test.xslt"?>
<book version="5.0">
<title>Title</title>
</book>
.... and another simple XSLT document (test.xslt):
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html><body> <h1><xsl:value-of select="book/title" /></h1> </body></html> </xsl:template> </xsl:stylesheet>
The problem is that if I add xmlns="http://docbook.org/ns/docbook" to the book-element neither my XML editor (XML Notepad 2007) nor my browser (Opera 9.26) show the book title anymore. However without xmlns my XML editor doesn't know of course where the DocBook tags come from.
Is this a problem of my tools or XSLT simply doesn't like xmlns? In the latter case is there any workaround?
Boris
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="test.xslt"?>
<book version="5.0">
<title>Title</title>
</book>
.... and another simple XSLT document (test.xslt):
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html><body> <h1><xsl:value-of select="book/title" /></h1> </body></html> </xsl:template> </xsl:stylesheet>
The problem is that if I add xmlns="http://docbook.org/ns/docbook" to the book-element neither my XML editor (XML Notepad 2007) nor my browser (Opera 9.26) show the book title anymore. However without xmlns my XML editor doesn't know of course where the DocBook tags come from.
Is this a problem of my tools or XSLT simply doesn't like xmlns? In the latter case is there any workaround?
Boris