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

Re: aborting element creation

Subject: Re: aborting element creation
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Thu, 10 Feb 2005 18:24:39 +0100
joris gillis
Thanks for answering.

Tempore 18:01:03, die 02/10/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Michael Kay <mike@xxxxxxxxxxxx>:

I've no idea what you mean by "with no decisive structure or pattern
matching", or why you want to constrain the solution, but the obvious way to
solve your problem is by have two template rules one with match="node" and one with match="node[@encapsulate]".
This is what I mean with "pattern matching". (Sorry, I'm quite bad at using correct terminology)
It solves of course my trivial and fictional XML problem, but is no answer to my real question (which I might have asked in a non-intelligible manner).

Your template, when it processes a node with no @encapsulate attribute, is generating an element whose name is "", which will obviously fail.
Indeed, but why can't the 'xsl:element' not just do nothing instead of raising an error when the name is empty?

So that this template:

<xsl:template match="/">
		<xsl:element name="">

would generate the same result as:

<xsl:template match="/">

So <xsl:element name=""/> would be treated somewhat like <xsl:for-each select="."/>

I know XSL1.0 does not behave like this; I wanted to know if XSL2.0 did, or if there were tricks to simulate the behaviour without 'xsl:test' or XPath testing.

regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Vincit omnia simplicitas Keep it simple

Current Thread


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.
First Name
Last Name
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.