[thelist] XSL:IF Question

nate koechley nate at vicksburgcollective.com
Thu Sep 6 12:56:12 CDT 2001


hi darren,

i don't have a great specific answer to your question, but you could try 
this general structure, instead of using "if''s"
<snippet type="sample xslt">

         <xsl:for-each select="filestorage:id">
                 <xsl:choose>
                         <xsl:when test="something = something">
                                 do something
                                 <xsl:apply-templates />
                         </xsl:when>
                         <xsl:otherwise>
                                 do something else
                                 <xsl:apply-templates />
                         </xsl:otherwise>
                 </xsl:choose>
         </xsl:for-each>

</snippet>

here are some other resources to try:

<tip type="xsl / xslt / xml resources" author="nate koechley">
i'm on this list and it's pretty good so far: 
http://www.vbxml.com/xsltalk/default.asp . there are some rockstars on it, 
who seem to enjoy answering questions. this is the best site i've found for 
resources and community: http://www.topxml.com/ (they moderate the above list)

these are other resources recommended to me, but i've been pretty happy 
with the above links and haven't spent much time looking at them yet. YMMV.
http://www.xmltrainer.com
http://www.mulberrytech.com
http://www.devgru.com
http://www.xml101.com
http://www.netcrucible.com
http://p2p.wrox.com
http://www.freevbcode.com
http://www.perfectxml.code
http://www.exploringxml.com
http://www.zvon.org

disclaimer: not affiliated with any resources linked above. just a user.
</tip>

cheers,
nate

At 06:32 PM 9/6/2001 +0100, you wrote:
>Evenin' all...
>
>i think my brain has finally turned to mush, so if anyone can help with
>this...
>
>i have an xml document with the following sort of structure:
>
>    <booking>
>       <generalinfo index="1">some text</generalinfo>
>       <generalinfo index="2">some more text</generalinfo>
>       <generalinfo index="3">even more text</generalinfo>
>    </booking>
>
>if there has been no text entered the first value is defaulted to '//'
>with the second two being random gibberish.  what i want to do is test to
>see if the first field is '//' and if so not show anything, otherwise
>show the text.
>
>i've managed to get either nothing or everything so far, which i think is
>a problem with matching the //'s.  i've tried escaping them with \'s so
>you would have something like:
>
>    <xsl:if test="//booking/generalinfo != '\/\/'">
>
>and various variations on that theme...and i always get either everything
>or nothing regardless of what the data is.
>
>anyone any ideas??
>
>and as a final question, has anyone got any recommendation for xml site
>that give *good* examples of the various bits??  most of them i've come
>across seem to stop at a rather basic level.
>
>thanks for any help,
>
>darren.
>
>
>---------------------------------------
>For unsubscribe and other options, including
>the Tip Harvester and archive of TheList go to:
>http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list