RE: [xsl] problem with xsl:choose

Subject: RE: [xsl] problem with xsl:choose
From: "Student1 ASCO-ELK (RBJE/ELK)" <Student1.ASCO-ELK@xxxxxxxxxxxx>
Date: Fri, 25 May 2001 11:19:34 +0200
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@xxxxxxxxxxx]
Sent: Friday, May 25, 2001 5:51 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
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


Current Thread