Re: [xsl] Namespace Problem

Subject: Re: [xsl] Namespace Problem
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 16 Jul 2008 14:26:56 +0200
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/

Current Thread