Subject: RE: [xsl] problem with xsl:choose From: "Christopher R. Maden" <crism@xxxxxxxxx> Date: Fri, 25 May 2001 03:11:29 -0700 |
unfortunately i have some book about xlst ;)
my xml file <data> <screen h=2 w=3 /> .... <table h=2 w=4 /> .... </data>
sorry, i forget to mention that, the <screen> and <table> are NOT mandatory. the xmldocument varies and if for example the <table> tag is not in the document i dont want the <table name='table'> to be in the final document.
<xsl:template match="/"> <xsl:if test="not(//screen) and not(//table)"> <xsl:message>error</xsl:message> </xsl:if> <xsl:apply-templates select="//screen|//table"/> </xsl:template>
<xsl:template match="screen"> <table class=screen> <xsl:attribute name=tID> <xsl:value-of select="@h"/> <xsl:attribute> <xsl:call-template name='screenHdr'/> <!-- put whatever is in your current screen template here --> </table> </xsl:template>
<xsl:template match="table"> <table class=table> <xsl:attribute name=tID> <xsl:value-of select="@h"/> <xsl:attribute> <xsl:call-template name='tableHdr'/> <!-- put whatever is in your current table template here --> </table> </xsl:template>
i cant use only the <xsl:apply-templates ... /> because i dont want the <table ...></table> to appear in the outputfile
you know now what i mean ?
-Chris -- Christopher R. Maden, XML Consultant DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training <URL: http://crism.maden.org/consulting/ > PGP Fingerprint: BBA6 4085 DED0 E176 D6D4 5DFC AC52 F825 AFEC 58DA
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] problem with xsl:choose, Student1 ASCO-ELK (R | Thread | Re: [xsl] problem with xsl:choose, Jeni Tennison |
[xsl] position of an element, Sebastian Schirmer | Date | Re: [xsl] problem with xsl:choose, Jeni Tennison |
Month |