xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xmlizer <mo...@netcourrier.com>
Subject How to surround an element with efficacity ?
Date Mon, 08 Nov 2004 11:35:38 GMT

As I am writing XSLT documents, i was in a some case in this situation :

In one case, i want to surround an element with another one, in another 
case i don't

example :

if (@LINKED=='true') {
	<a href="....">
} else {

I name this case "conditional surrounding"

where content is a multiline stuff

of course i see some of those saying i just have to call a template, but 
  the content stuff use a lot of parameters so it is the same to 
copy/paste than to make a call.

So my questions are those

1) Can be handled simply in strict XSLT 1.0 ?
2) Can be handled simply with some extension of XSLT 1.0 ?
3) Can it be handled simply with last XSLT 2.0 WD ?
4) with XQuery ?
5) should I use XSP ?
6) Should I use direct programming langages ?
7) Should I change the structure of the XML input and how ?


Of course there is a awful way to do that with

and $name could be "a" or "span" for exemple

<xsl:variable name="name">
     <xsl:when test="@LINKED=='true'">a</xsl:when>

<xsl:element name="{$name}">
   <xsl:if test="$name == a">
     <xsl:attribute name="href" select="$href" />



To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message