This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: problem with xsl:choose
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] problem with xsl:choose
- From: "Student1 ASCO-ELK (RBJE/ELK)" <Student1 dot ASCO-ELK at jp dot bosch dot com>
- Date: Fri, 25 May 2001 11:19:34 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
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.
my xsl file
xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match='/'>
<xsl:choose>
<xsl:when select='//screen'>
<table class=screen>
<xsl:attribute name=tID><xsl:value-of select="@h"
/><xsl:attribute>
<xsl:call-template name='screenHdr'/>
<xsl:apply-templates select='//screen />
</table>
</xsl:when>
<xsl:when select='//table'>
<table class=table>
<xsl:attribute name=tID><xsl:value-of select="@h"
/><xsl:attribute>
<xsl:call-template name='tableHdr'/>
<xsl:apply-templates select='//table />
</table>
</xsl:when>
<xsl:otherwise>
error
</xsl:otherwise>
</xsl:choose>
</xsl:stylesheet>
</xsl:stylsheet>
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 ?
thx in advance cu goose
-----Original Message-----
From: Goetz Bock [mailto:bock@blacknet.de]
Sent: Friday, May 25, 2001 5:51 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] problem with xsl:choose
On Fri, May 25 '01 at 10:27, Student1 ASCO-ELK (RBJE/ELK) wrote:
> i cant use the <xsl:apply-templates .../>
> because of the 'FOOBARs' and 'BLABLABLAs' ;)
> i dont want them to be seen in the final document
You should most likely get a book about XSL-T ;-)
I've not been able to figure out, what you realy want. Could you provide
a stripped down version of
- your source XML document
- your intended output
Both files should be as brief as possible but as complete as possible.
I'm sure some one on this list can point you into the right direction
with this two files,
Goetz.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list