[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

simple xsl:choose question part 2

Subject: simple xsl:choose question part 2
From: Meir <umen@xxxxxxxxxxxxxxxx>
Date: Tue, 18 Jun 2002 01:50:22 -0700
simple xsl file
first of all tnx for the reply's folks
(i hate to be newbe)
any way .. now that i have this choose working fine i have new problem .
im trying to close every <dir..../><File/><File/><File/> with <span> tag in
the so in the end it will be

<span>  <-------------------------------------this is the span i like to
add.
    <span><dir..../></span>
    <span><File/><span>
    <span><File/><span>
    <span><File/><span>
        <span>  <-------------------------------------this is the span i
like to add.
            <span><dir..../></span>
            <span><File/><span>
            <span><File/><span>
            <span><File/><span>
                <span>  <-------------------------------------this is the
span i like to add.
                   <span><dir..../></span>
                   <span><File/><span>
                   <span><File/><span>
                    <span><File/><span>
                </span> <-------------------------------------this is the
close span i like to add
        </span> <-------------------------------------this is the close span
i like to add
</span> <-------------------------------------this is the close span i like
to add



now i have worked the way to add the inner span's but i can't figger the way
how to inssert the outer span that holds inside all the <span>s

here is the xsl file i have :
----------------------------------------------------------------------------
------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet  version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
    <xsl:for-each select="/CdList//*">
 <xsl:call-template name="print"/>
 </xsl:for-each>
 </xsl:template>
 <xsl:template name="print">
  <xsl:choose>
 <xsl:when test="@type='father'">
 <span style="border:'1px solid red';width:auto">
  <xsl:value-of select="name()"/><xsl:text>=</xsl:text>
  <xsl:value-of select="./@id"/>
 </span>
 </xsl:when>
 <xsl:otherwise>
     <span style="border:'1px solid black';width:auto;padding-left:20">
  <xsl:value-of select="name()"/><xsl:text>=</xsl:text>
  <xsl:value-of select="./@id"/>
 </span>
 </xsl:otherwise>
    </xsl:choose>
 <br/>
    </xsl:template>
</xsl:stylesheet>

and here is the xsl file :
----------------------------------------------------------------------------
--------------------------
<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="flashCTL.xsl"?>
<CdList>
<Dir id="flash"  type="father">
<File id="battletank.zip"  type="child" />
<File id="flashquest.zip"  type="child" />
<File id="3d.fla"  type="child" />
<File id="3d.swf"  type="child" />
<File id="3D_Engin-KStor-189.zip"  type="child" />
<Dir id="1"  type="father"><File id="level1.txt"  type="child" />
<File id="flash_quest.swf"  type="child" />
<File id="level2.txt"  type="child" />
<File id="level3.txt"  type="child" />
<File id="level4.txt"  type="child" />
<File id="FKSingapore.txt"  type="child" />
</Dir>
<Dir id="3D_Engin"  type="father">
<File id="3DengineForDummies.fla"  type="child" />
<File id="3DengineForDummies.swf"  type="child" />
<File id="actionscriptsummary.swf"  type="child" />
<File id="button.jpg"  type="child" />
<File id="line.jpg"  type="child" />
<File id="rotating menu.html"  type="child" />
<File id="TheWayWeDoIt.jpg"  type="child" />
</Dir>
</Dir>
</CdList>
--------------------------------------------------------------------
thanks















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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.