Matching namespaces on source documents

Subject: Matching namespaces on source documents
From: "Richman, Jeremy" <jrichman@xxxxxxxxxxxx>
Date: Mon, 8 Nov 1999 12:06:28 -0500
Do both XT or LotusXSL fail to process namespaces from the source document,
or (more likely)
is my source document not declaring the namespaces properly?

I have the following stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml"/>

<xsl:template match="/">
   <xsl:apply-templates/>
</xsl:template>

<xsl:template match="test:foo">
  <TEST.FOUND/>
</xsl:template>

<xsl:template match="*" priority="-1.0">
  <TEST.MISSED/>
</xsl:template>

</xsl:stylesheet>

My source document is:
<?xml version="1.0"?>
<document xmlns:test="http://www.test.org";>
<test:foo>Element foo with namespace test</test:foo>
<document>

When I use XT to apply the stylesheet to the document, I get an error
message:
   test.xsl:13: undefined prefix
where line 13 is the tempate trying to match xsl:foo.

I have also tried LotusXSL, which requires changing the xsl declaration to
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";>

but this generates a Java runtime exception.  The message in the stack dump
says there
was an ElemTemplateError: cannot resolve namespace prefix: test.

What am I doing wrong?

Jeremy


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread