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

RE: A beef with XSLT Sometimes too complicated

Subject: RE: A beef with XSLT Sometimes too complicated
From: "Geert Josten" <geert.josten@xxxxxxxxxxx>
Date: Fri, 14 Jul 2006 09:23:55 +0200
beef dummy
> I too am annoyed by the syntax. My pet peev is that
> xsl:attribute has to be the first element. This is really
> annoying if you want to optionally add an attribute.

xsl:attribute is not necessarily the first child element within
xsl:template or xsl:element, but does need to follow element insertion
directly.

VALID:

<xsl:element name="dummy">
  <xsl:attribute name="id">bla</xsl:attribute>
</xsl:element>

<xsl:element name="dummy">
  <xsl:variable name="test" />
  <xsl:attribute name="id">bla</xsl:attribute>
</xsl:element>

<xsl:element name="dummy">
  <xsl:call-template name="copy-some-attributes"/>
  <xsl:call-template name="doesnt-write-to-target-tree"/>
  <xsl:attribute name="id">bla</xsl:attribute>
</xsl:element>

<xsl:element name="dummy">
  <xsl:variable name="myrtf">
    <xsl:call-template
name="calculate-tree-fragment-with-comments-elems-etc"/>
  </xsl:variable>
  <xsl:attribute name="id">bla</xsl:attribute>
</xsl:element>

<xsl:element name="dummy">
  <xsl:variable name="mybool">
    <xsl:if test="$x = 'y'">YES!</xsl:if>
  </xsl:variable>
  <xsl:if test="$mybool = 'YES!'"> <!-- ignore the silly boolean
statements ;-) -->
    <xsl:attribute name="id">bla</xsl:attribute>
  </xsl:if>
</xsl:element>

INVALID:

<xsl:element name="dummy">
  <xsl:comment>Not allowed here!</xsl:comment>
  <xsl:attribute name="id">bla</xsl:attribute>
</xsl:element>

<xsl:element name="dummy">
  <xsl:processing-instruction name="test">Not allowed
here!</xsl:processing-instruction>
  <xsl:attribute name="id">bla</xsl:attribute>
</xsl:element>

<xsl:element name="dummy">
  <xsl:call-template
name="calculate-tree-fragment-with-comments-elems-etc"/>
  <xsl:attribute name="id">bla</xsl:attribute>
</xsl:element>

Kind regards,
Geert


Drs. G.P.H. Josten
Consultant



Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl


De informatie - verzonden in of met dit emailbericht - is afkomstig van
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit
bericht kunnen geen rechten worden ontleend.

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.