[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: aborting element creation
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]". Your template, when it processes a node with no @encapsulate attribute, is generating an element whose name is "", which will obviously fail. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Joris Gillis [mailto:roac@xxxxxxxxxx] > Sent: 10 February 2005 16:43 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: aborting element creation > > Hi XSL guru's and experts, > > I was wondering... > Is there a way (in XSLT1.0 or 2.0) to prohibit an element to be > constructed and added to the result tree, while other XSL > instruction > inside are being processed normally? > > > In other words, how can I transform this XML: > <root> > <node encapsulate="container"/> > <node/> > </root> > > into this: > > <root> > <container> > <node encapsulate="container"/> > </container> > <node/> > </root> > > without any decisive structure or pattern matching? > > > the following template throws an error about the Qname (XSLT1.0): > > <xsl:template match="node"> > <xsl:element name="{@encapsulate}"> > <xsl:copy-of select="."/> > </xsl:element> > </xsl:template> > > > Thanks in advance > -- > Joris Gillis > (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) > Vincit omnia simplicitas > Keep it simple
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|