Another newbie question

Subject: Another newbie question
From: Sanjay Saxena <ssaxena@xxxxxxxxxxxxx>
Date: Tue, 07 Dec 1999 17:42:49 -0800
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