Subject: [xsl] Recursive problem From: "Satish, L. Gnanendra" <LGnanendra.Satish@xxxxxxxxxx> Date: Wed, 18 Sep 2002 06:35:40 +0200 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] copy nodes as keys, Jarno . Elovirta | Thread | Re: [xsl] Recursive problem, Mike Brown |
[xsl] copy nodes as keys, Thomas Olausson | Date | [xsl] RE: sorting on data reference, Dimitre Novatchev |
Month |