surveyer
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by surveyer
-
-
This is the output of your code:what are all those variables coming from?code:<xsl:choose><xsl:when test="name='jane'">yes</xsl:when><xsl:otherwise>no</xsl:otherwise></xsl:choose>
that should write yes if jane is there, no if not.LG
nono
I just want one 'no' since Jane is not in the list.Btw, this is my code that yields that 2 'no's
<xsl:template match="Workers"> <xsl:apply-templates select="Worker"/></xsl:template><xsl:template match="Worker"><xsl:choose><xsl:when test="name='Jane'">yes</xsl:when><xsl:otherwise>no</xsl:otherwise></xsl:choose></xsl:template>
-
If I use 'if' or 'when' to find that Jane is in the Workers list, it can be done:<xsl:if test="$wname=$ename"><found><xsl:value-of select="$wname"></found></xsl:if>But if I use 'if' or 'when' to find that Jane should not be in the Workers list, that I cannot know how:<xsl:for-each blah blah blah><xsl:choose><xsl:when test="$wname!=$ename"><notfound><xsl:value-of select="$ename"></notfound></xsl:when></xsl:choose></xsl:for-each>This last code will give two redundant answers if 'printed' into HTML:<notfound>Jane</notfound><notfound>Jane</notfound>Ok, link:http://www.w3schools.com/xsl/el_when.aspif you still can't sort it out, ask again and I'll post code.LG -
Hi there,I am new to XML and XSL, so please bear with me if I ask simple questions.At the moment I have a problem to check availability of a worker in a list of workers.Here is the code:<Workers> <Worker id="1"> <name>John</name> </Worker> <Worker id="2"> <name>Smith</name> </Worker></Workers>I want to check if there is a worker called 'Jane' in the XML above by using XSL.<employees> <employee> <name>Jane</name> </employee></employees>And if Jane is not in the XML, I want to return a notification that Jane is not in the XML.How could I do this?Please help me.
List in XSL?
in XSLT/XSL-FO
Posted
Anyone can help me?I want to check whether an element is in the list of tags.