[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
elemtemplateerror
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.