Re: Matching namespaces on source documents

Subject: Re: Matching namespaces on source documents
From: "Nikolai Grigoriev" <grig@xxxxxxx>
Date: Mon, 8 Nov 1999 22:20:24 +0300
If you use prefixes in the stylesheet, they must be declared there;
declaring them in the XML source only is not enough. Just add
xmlns:test="http://www.test.org"; attribute to <xsl:stylesheet>.

Nikolai

-----Original Message-----
From: Richman, Jeremy <jrichman@xxxxxxxxxxxx>
To: 'XSL-List@xxxxxxxxxxxxxxxx' <XSL-List@xxxxxxxxxxxxxxxx>
Date: Monday, November 08, 1999 10:16 PM
Subject: Matching namespaces on source documents


>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



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


Current Thread