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

RE: Error message when match=$variable

Subject: RE: Error message when match=$variable
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 4 Sep 2001 06:23:14 +0300
english.xml download
> When I run the following stylesheet with
> <xsl:template match="$english/node()">,
> which should display all the nodes of the english.xml, I get an error

A variableReference cannot be used in a Pattern

> XSL:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:variable name="english"
> select="document(languages/english.xml)/language"></xsl:variable>

You're not looking for the document URL from the english.xml child of
language child, but rather from a relative URL languages/english.xml, so the
expression inside document() should be in quotes

> <xsl:variable name="german"
> select="document(languages/german.xml)/language"></xsl:variable>

Same here

> <xsl:template match="/">
> <html>
> <head>
> </head>
> <body>
> 	<textarea rows="20" cols="100">
> 	<xsl:apply-templates select="$english/node()" />

You don't want to process the whitespace, so use $english/* 

> 	</textarea>
> </body>
> </html>
> </xsl:template>
> 
> <xsl:template match="$english/node()">

Just node() or * will do

> <xsl:value-of select="name()" /> = <xsl:value-of select="." />&#10;

The &#10; as such will be removed by the XSLT engine during whitespace
stripping, so wrap it into xsl:text

> </xsl:template>
> 
> </xsl:stylesheet>

Jarno

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


Current Thread
  • Error message when match=$variable
    • timw - Mon, 3 Sep 2001 22:27:23 -0400 (EDT)
      • <Possible follow-ups>
      • Jarno . Elovirta - Mon, 3 Sep 2001 23:31:24 -0400 (EDT) <=
      • timw - Tue, 4 Sep 2001 00:59:58 -0400 (EDT)
      • timw - Tue, 4 Sep 2001 01:10:41 -0400 (EDT)
      • timw - Tue, 4 Sep 2001 02:31:57 -0400 (EDT)
      • Jarno . Elovirta - Tue, 4 Sep 2001 03:21:44 -0400 (EDT)

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-2007 All Rights Reserved.