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

Copy a node inside a template but exclude a deeply nes

Subject: Copy a node inside a template but exclude a deeply nested child
From: "Adam Retter" <adam.retter@xxxxxxxxxxxx>
Date: Mon, 4 Sep 2006 12:46:08 +0100
body cutting
Hi Chaps,

I have an existing xslt and in one of the templates it makes a copy of a
node from the xml document, I now have the need to exclude a deeply
nested child from that copy, but I cant figure out how, I may need to
break up my template into further templates but im not sure how
exactly...

My simplified XML document looks like this -

<root>
    <categories_flat/>
    <pages/>
    <page>

        <!-- cut: lots of nodes -->

        <content>
            <main>
                <show>
                    <h1>General Enquiries</h1>
                    <p>This form is for general enquiries only.</p>
                    <br/>
                    <div id="xform">
                        <xforms:model>
                            <!-- cut: xform model -->
                        </xforms:model>
                    </div>
                </show>
            </main>
        </content>

    </page>
</root>


My current my XSLT document is below.
Now at the moment it deep copies the nodes inside the show node, but I
would like to exclude the xforms:model node, I cant really reference
this node by path as its nesting may be different each time, although it
will always be somewhere inside a child of the show node, although its
depth may vary. So, how can I acheieve this?


<xsl:template match="/page">
    <html>
        <head>
            <title>some page title</title>
        </head>
        <body>

            <!-- cut: lots of node parsing and xhtml generation -->

            <xsl:if test="content/main/show">
                <div class="textpage"><!-- text page -->
                    <xsl:copy-of select="content/main/show/node()"/>
                </div>
            </xsl:if>

        </body>
    </html>
</xsl:template>


Thanks Adam



Adam Retter

Devon Portal Principal Developer
Devon Portal Project, e-Partnership
Ext: 3683
DDI: 01392 383683
e: adam.retter@xxxxxxxxxxxx

http://www.devonline.gov.uk

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.