Re: [xsl] Namespace problem

Subject: Re: [xsl] Namespace problem
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Tue, 26 Feb 2002 14:50:27 -0500

Your xml file has a default namespace,  Therefore,
the "item" element is in that namespace.  For the xslt processor to match
it, it needs to know it should look for the "item" element ***in that
namespace***.  To do that, you need to declare the namespace in the
stylesheet, using an arbitrary prefix (it cannot be the default namespace
because the template needs to match a name with a prefix).  You use that
prefix with the element's name.  Here is an example using your xml file:

<xsl:stylesheet version="1.0"

<xsl:template match="/">
        <xsl:value-of select='count(//xx:item)'/> "item" element(s)

<xsl:template match='*'/>

Here are the results of running this stylesheet on your file:

  <result> 1 "item" element(s)</result>


Tom P

[Eric Vitiello]

I'm trying to apply a simple transformation to the file below, and for some
reason I'm unable to get any nodes returned.  I think it may be a namespace
issue.  I'm totally stumped, and losing hair.

apply this XPath:  //item

should return a nodeset of items

the XML:

<?xml version="1.0"?>

<channel rdf:about="";>
<title>Perceive Designs</title>
<description>Your perception of design and technology</description>
<lastBuildDate>Tue, 26 Feb 2002 13:26:00 GMT</lastBuildDate>
<managingEditor>eric@xxxxxxxxxxxx (Eric Vitiello)</managingEditor>
<webMaster>webmaster@xxxxxxxxxxxx (Perceive Designs Webmaster</webMaster>

<title>FamilyML DTD Released</title>
<p>The DTD used in created in the <a href="";>Vitiello
Family Tree</a> has finally been released to the public. You can read about
the FamilyML specification and download the DTD at the <a
href="";>Vitiello Family Tree
Website</a>.  The Current version of the DTD, 0.5 may be linked directly to
at: <a

 XSL-List info and archive:

Current Thread