xsl-list
[Top] [All Lists]

Re: [xsl] Namespace Problem

2008-07-16 05:27:22
Byomokesh Sahoo wrote:

<book xmlns="http://docbook.org/ns/docbook";>
<title>Endless Universe</title>
<subtitle>Beyond the Big Bang</subtitle>
........
</book>

The elements are in the namespace http://docbook.org/ns/docbook, to select or match them with XPath 1.0/XSLT 1.0 you need to qualify element names e.g.
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns="http://www.w3.org/1999/xhtml";
                xmlns:h="http://www.w3.org/1999/xhtml";
                xmlns:ng="http://docbook.org/docbook-ng";
                xmlns:db="http://docbook.org/ns/docbook";
                exclude-result-prefixes="db ng">
  <xsl:output method="html" indent="yes" encoding="ISO-8859-1"/>
  <xsl:template match="book">

    <xsl:template match="db:book">

          <xsl:value-of select="title"/>

            <xsl:value-of select="db:title"/>

and so on.


--

        Martin Honnen
        http://JavaScript.FAQTs.com/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>