xsl-list
[Top] [All Lists]

[xsl] Could XPath identify markup generated in XSL?

2011-04-12 17:51:31
XSL version: 1
Vendor: Microsoft
Vendor URL: http://www.microsoft.com
Upgrade to XSLT 2 not viable
================================

Suppose an XML file ("A") references an XSL file.
That XSL file copies a node-list from another XML file ("B").
Among other things, B contains the element "<that>".
Within the XSL, can I now target <that> for XSLT?

If XSL can't identify/query for markup that it itself generated, are
there alternative approaches to solving this problem?

========= SAMPLE DATA ===========


ENTRY.XML (aka, "A")
{
    <?xml version="1.0" encoding="utf-8" ?>
    <?xml-stylesheet type="text/xsl" href="bind.xsl"?>
    <root/>
}


GUI.XML {aka, "B")
{
        <html>
            <head>
                <link rel="stylesheet" href="style.css" type="text/css"
/>              </head>

            <frameset rows="50,*">
                <frame name="header" src="img/hdr.jpg" />
                <frame name="body"><app/></frame>
              <!--               ^^^^^      -->
            </frameset>
        </html>
}


BIND.XSL
{
        <?xml version="1.0" encoding="utf-8" ?>
        <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
                <xsl:template match="/">
                <xsl:copy-of select="document('gui.xml')" />
                <xsl:apply-templates />
                </xsl:template>


          <!-- THE APP ELEMENT (BELOW) WAS JUST 
                COPIED FROM THE ABOVE "COPY-OF" -->

            <xsl:template match="//app">
                <xsl:copy-of select="document('app.aspx)" />
            </xsl:template>
        </xsl:stylesheet>
}



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>