| 
 
Subject: Re: [xsl] Simple Question From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 30 Jan 2007 22:19:52 +0100  | 
I know that this is a really simple question but I just can't seem to figure it out. I want to print out xml if a certain condition is true, so I thought the bottom would work, but of course it isn't valid xml. Any ideas?
<xsl:if test="$a != $times">
<xqx:orOp>
<xqx:firstOperand>
</xsl:if>
<xsl:if test="somecondition"> <sometag> <!-- open the tag --> </xsl:if>
<xsl:if test="somecondition"> </sometag> <!-- close the tag --> </xsl:if>
<xsl:template match="somematch">
  <xsl:choose>
  <xsl:when test="$a != $times" >
      <xsl:apply-templates select="somechild" mode="create-orOp" />
  </xsl:when>
  <xsl:otherwise>
     <xsl:apply-templates select="somechild" />
  <xsl:otherwise>
  <xsl:choose>
</xsl:template><xsl:template match="somechild"  mode="create-orOp">
   <xqx:orOp>
       <xqx:firstOperand>
            <xsl:apply-templates select="self::somechild" />
       </xqx:firstOperand>
   </xqx:orOp>
</xsl:template><xsl:template match="somechild"> ... do something ... </xsl:template>
Cheers, -- Abel Braaksma http://www.nuntia.nl
| Current Thread | 
|---|
  | 
| <- Previous | Index | Next -> | 
|---|---|---|
| [xsl] Simple Question, Punnoose, Roshan | Thread | RE: [xsl] Simple Question, Michael Kay | 
| Re: [xsl] PARAMS and VARIABLES in X, mark bordelon | Date | Re: [xsl] PARAMS and VARIABLES in X, Florent Georges | 
| Month |