|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Writing an optional element
>>>>> "Nestor" == Nestor Boscan <nestor.boscan@xxxxxxxxxx> writes:
Nestor> Hi I have an XSL template that has to write an element
Nestor> depending on a condition.
Nestor> If Condition is true
Nestor> <element> ... continue processing ... </element>
Nestor> If Condition is false
Nestor> ... continue processing ...
Nestor> Is there a better way to do it than:
Nestor> <xsl:choose> <xsl:when test="condition"> <element>
Nestor> ... processing instructions ... </element> </xsl:when>
Nestor> <xsl:otherwise> ... repeat processing instructions ...
Nestor> </xsl:otherwise> </xsl:choose>
If by a better way, you mean you want to avoid writing the same
"continue processing" code, then you could call a named template
each time. Said named template to contain the common code.
--
Colin Paul Adams
Preston Lancashire
|
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
|

Cart








