Re: [xsl] xsl:if prob with attribute

Subject: Re: [xsl] xsl:if prob with attribute
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Fri, 16 Aug 2002 13:28:12 +0000
Jarkko,
The following code will help you.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
<xsl:apply-templates select="XDocument/XDocCell/XDocUserInput[starts-with(@name,'C')]"/>
</xsl:template>
<xsl:template match="XDocUserInput">
<xsl:value-of select="."/><br/>
</xsl:template>
</xsl:stylesheet>



From: Jarkko.Moilanen@xxxxxx
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [xsl] xsl:if prob with attribute
Date: Fri, 16 Aug 2002 12:23:01 +0300 (EEST)

Hi!

I've been stuck on this problem for a while and I don't
whats wrong with my xslt. I need to select elements
whose attribute name value starts-with "C".

XSLT:
<snip>
<xsl:variable name="XDocContent" select="XDocument/XDocCell"/>
<xsl:if test="$XDocContent/XDocUserInput/@name=(starts-with(.,'C'))">

<p><input type="checkbox" value="ON" disabled="true" checked="true"></input>
<xsl:value-of select="$XDocContent[@row=$row and @col=$col]/XDocPosttext"/>
</p>
<snip>



XML: <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <XDocument> <XDocTemplate>Dokkari8</XDocTemplate> <XDocCellHeader row="1" col="1"> <Organization>abc</Organization> <Department>jkl</Department> <DiaryNum>ghi</DiaryNum> <XDocType>def</XDocType> <DateTime>mno</DateTime> </XDocCellHeader>

  <XDocCell row="4" col="1">
    <XDocUserInput name="C2">on</XDocUserInput>
    <XDocPosttext>Check-box1</XDocPosttext>
  </XDocCell>

  <XDocCell row="5" col="1">
    <XDocPretext>Fill-in1</XDocPretext>
    <XDocUserInput name="F1">fdsafsadfsadfsadfsadf</XDocUserInput>
  </XDocCell>

</XDocument>

Cheers
Jarkko


**************************************************************** Jarkko Moilanen "Erehtyminen on inhimillista, Researcher/ ITCM mutta todella suuret mokat jm60697@xxxxxx vaativat tietokoneen käyttöä." www.uta.fi/~jm60697 GSM: +358 50 3766 927 **************************************************************** * ITCM | Information Technology and Crisis Management * http://www.itcm.org ****************************************************************

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread