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

Re: Re: recursive help

Subject: Re: Re: recursive help
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 26 Sep 2003 22:41:04 +0200
xsl transform xml recursive
So where did "standard" elements disappear?

Also, what is the rule for producing the numbers?  I don't see in the output
any subsections, while your source.xml is nested and probably will result in
sections having subsections.

To put it shortly, this output bears no resemblance to the source.xml

Could you, please, provide a short but complete example, that shows how
exactly your source.xml will have to be transformed?


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


"Wagstaff, Jason" <WagstaffJ@xxxxxxxxxxxx> wrote in message
news:8ECAAC981350F94084F02B5E7699DC600AB479@xxxxxxxxxxxxxxxxxxxxx
> I would like the results to look something like this. It is sort of like a
book,section,chapter senario.
>
> <h>title of book</h>
> <h>Section 1</h>
> <a>chapter 1</a>
> <h>chapter 2</h>
> <a>subchapter 1</a>
> <h>Section 2</h>
> <a>chapter 1</a>
> <a>chapter 2</a>
> <h>Section 3</h>
> <h>Section 4</h>
> <a>chapter 1</a>
>
> the problem is that I will never know how deep/levels the standard can be.
>
> tia,
> jason
>
> -----Original Message-----
> From: Dimitre Novatchev [mailto:dnovatchev@xxxxxxxxx]
> Sent: Friday, September 26, 2003 2:57 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Re: recursive help
>
>
> And what should be the output?
>
>
> =====
> Cheers,
>
> Dimitre Novatchev.
> http://fxsl.sourceforge.net/ -- the home of FXSL
>
> "Wagstaff, Jason" <WagstaffJ@xxxxxxxxxxxx> wrote in message
> news:8ECAAC981350F94084F02B5E7699DC600AB478@xxxxxxxxxxxxxxxxxxxxx
> > i have an xml document that needs to be transformed which seems to
perfect
> for recursion. (this is my first attempt at trying this) it is essentialy
a
> nested menu system of links. the basic logic is it checks to see if a node
> has a child, if it does print a header otherwise a link.    i built the
xml
> document using recursion, i just can't figure out how to transform it
useing
> the same technique. samples of both xml and xslt
> >
> >
> > xml doc:
> > <?xml ?>
> > <standards>
> >    <standard id="1" name="test">
> >         <standard id ="32" name="test" />
> >         <standard id ="45" name="test>
> >              <standard id ="23" name="test" />
> >              <standard id ="12" name="test" />
> >          </standard>
> >    </standard>
> > </standards>
> >
> > xslt:
> > <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> >
> > <xsl:template name="buildmenu">
> > <xsl:param name="foo" />
> > <xsl:choose>
> > <xsl:when test="position()!=last()">
> > <xsl:choose>
> > <!-- test to see if foo has children
> > if so print header -->
> > <xsl:when test="count($foo) != 0">
> > has child print header
> > <h2><xsl:value-of select="@name" /></h2>
> > <xsl:call-template name="buildmenu">
> > <xsl:with-param name="foo" select="$foo" />
> > </xsl:call-template>
> > </xsl:when>
> > <xsl:otherwise>
> > <!-- no children print link -->
> > <a><xsl:attribute
name="href">addlinkinfol8r</xsl:attribute><xsl:value-of
> select="@name" /></a>
> > <xsl:call-template name="buildmenu">
> > <xsl:with-param name="foo" select="$foo" />
> > </xsl:call-template>
> > </xsl:otherwise>
> > </xsl:choose>
> > </xsl:when>
> > <xsl:otherwise>
> > <a><xsl:attribute
name="href">addlinkinfol8r</xsl:attribute><xsl:value-of
> select="@name" /></a>
> > </xsl:otherwise>
> > </xsl:choose>
> > </xsl:template>
> >
> > <xsl:template match="standards">
> > <xsl:call-template name="buildmenu">
> > <xsl:with-param name="foo" select="standard" />
> > </xsl:call-template>
> > </xsl:template>
> >
> > <!--<xsl:template match="standards">
> > <xsl:for-each select="standard">
> > <a><xsl:attribute
name="href">addlinkinfol8r</xsl:attribute><xsl:value-of
> select="@name" /></a>
> > </xsl:for-each>
> > </xsl:template> -->
> >
> > </xsl:transform>
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
>
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>




 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.