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

Another newbie question

Subject: Another newbie question
From: Sanjay Saxena <ssaxena@xxxxxxxxxxxxx>
Date: Tue, 07 Dec 1999 17:42:49 -0800
sanjay saxena
Hi,

I am a newbie so please  bear with me. In my XML, I have
meta-data which references data. For example, my XML looks
as shown:

<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>

So, every container has a PRE_HTML and POST_HTML element
which references other nodes in my XML. For example, the
Departments container references the DEPT_PREHTML and
DEPT_POSTHTML nodes. The DEPT_PREHTML and DEPT_POSTHMTL
nodes look as shown:

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

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

Similarly, EMP_PREHTML and EMP_POSTHTML contain well-formed
HTML.

In my XSL, I would like to iterate through each of the
containers and spit out the well-formed HTML which is sitting in
the respective PRE_HTML and POST_HTML nodes. However, I am
not having any luck dereferencing the node name that is the
value of an element. In the XSL, I am using the xsl:copy-of
to spit out the node specified by the PRE_HTML and POST_HTML
elements of the CONTAINER. But, this does not work. The XSL
looks as shown below:

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

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

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

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

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

Can somebody shed any light on this? How do I spit out
the well-formed HTML sitting in various nodes that are
referenced by the PRE_HTML and POST_HTML elements?
 

Thanks in advance,
Sanjay

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.