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

Recursive problem

Subject: Recursive problem
From: "Satish, L. Gnanendra" <LGnanendra.Satish@xxxxxxxxxx>
Date: Wed, 18 Sep 2002 06:35:40 +0200
recursive problem
Hello,
 I am a novice to XML and I would need a quick solution from the Pro's to
the following problem:
 What I need is that the "Page" element in turn should recursively call
itself. Will anyone bail me out of this?

 The sample dtd snippet, in which I have scaled down the details(more
elemente) inside each ELEMENT is:
<!ELEMENT GUI (Page)*>
<!ELEMENT Page (Name, (Parameter)*, (Table)*, (Page)*)>  --> Recursive
<!ATTLIST Page ID CDATA #REQUIRED>
<!ELEMENT Table (Name, (Parameter)*)>
<!ATTLIST Table ID CDATA #REQUIRED>
<!ELEMENT Parameter (Name)>
<!ATTLIST Parameter ID CDATA #REQUIRED>

-----------------------------------------------------------------
and the sample xml is:
 <GUI>
  <Page ID="1">
    <Name>&text_19;</Name>
    <Parameter ID="1">
      <Name>&text_6;</Name>
    </Parameter>
    <Parameter ID="2">
      <Name>&text_12;</Name>
    </Parameter>
    <Page ID="1">
      <Name>&text_20;</Name>
      <Table ID="1">
        <Name>&text_21;</Name>
        <Parameter ID="1">
          <Name>&text_23;</Name>          
        </Parameter>
      </Table>
    </Page>
    <Page ID="2">
      <Name>&text_27;</Name>
      <Parameter ID="1">
        <Name>&text_28;</Name>
      </Parameter>
    </Page>
  </Page>  
 </GUI>

--------------------------------------------------------
and the xsl is:
  <xsl:template match="GUI">
    <xsl:if test="Page">
      <BR/>
      <xsl:for-each select="Page">
          <xsl:apply-templates select="Name"/>
          <xsl:if test="Parameter">
            <xsl:apply-templates select="Parameter"/>
          </xsl:if>
          <xsl:if test="Table">
            <xsl:apply-templates select="Table"/>
          </xsl:if>
          <xsl:if test="Page">
            ***** Here I have to recursively call the "Page" again *****
          </xsl:if>          
      </xsl:for-each>
    </xsl:if>
  </xsl:template>

Thanx in adv,
Gnanendra.
- - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - - 
This e-mail and any attachments may contain information which is
confidential, proprietary, privileged or otherwise protected by law. The
information is solely intended for the named addressee (or a person
responsible for delivering it to the addressee). If you are not the intended
recipient of this message, you are not authorized to read, print, retain,
copy or disseminate this message or any part of it. If you have received
this e-mail in error, please notify the sender immediately by return e-mail
and delete it from your computer.

 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.