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

Re: Another newbie question

Subject: Re: Another newbie question
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 8 Dec 1999 10:43:56 GMT
carlisle containers
     <xsl:template match="/CONTAINERS">
This only works if CONTAINERS is the document element but  you indicated
I think that your DEPT_POSTHTML elements were outside this.

        <xsl:copy-of select="PRE_HTML"
            <xsl:apply-templates select="*|@*|text()"/>
        </xsl:copy-of>

you are confusing the syntax for xsl:copy and xsl:copy-f. and also
that select expression starts from the current CONTAINER node, but
PRE_HTML isn't a child of that.

So....

===========================================
<x>
<CONTAINERS>
    <CONTAINER>
        <PRE_HTML>DEPT_PREHTML</PRE_HTML>
        <TITLE>Departments</TITLE>
        <POST_HTML>DEPT_POSTHTML</POST_HTML>
    </CONTAINER>
    <CONTAINER>
        <PRE_HTML>EMP_PREHTML</PRE_HTML>
        <TITLE>Employees</TITLE>
        <POST_HTML>EMP_POSTHTML</POST_HTML>
    </CONTAINER>
</CONTAINERS>

<DEPT_PREHTML>
    <DIV id="Layer1" style="position: absolute">
        <IMG src="/images/edu.gif" width="917"
height="104"/>
    </DIV>
</DEPT_PREHTML>

<DEPT_POSTHTML>
     <!-- Some more well formed HTML. -->kkk
</DEPT_POSTHTML>

</x>

===========================================

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"
                >

<xsl:output method="xml" indent="yes"/>


<xsl:template match="CONTAINERS">pppp
    <xsl:for-each select="CONTAINER">l

        <xsl:copy-of select="//*[name(.)=current()/PRE_HTML]" />

        <!-- Do some more things here -->

        <xsl:copy-of select="//*[name(.)=current()/POST_HTML]" />

    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>

===========================================

David
PS you see it is better to ask on the list, than to ask directly:-)

PPS You mail was included twice, once as text and once a HTML, please
don't do that.


 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.