Ok, what I'm attempting here is to process a specific block of XML based on
a CF Variable.
I think the problem lies somewhere in my CF code, but I may be mistaken.
=====================================
The following is my CF Code:
=====================================
<cfscript>
// This is the variable that I'm passing to the XSL Template
c="company";
source="#request.xmldoc#";
style="#request.xslContent#";
objSource=CreateObject("COM", "Microsoft.XMLDOM", "INPROC");
objSource.async = "false";
sourceReturn = objSource.load("#SOURCE#");
// =================================================================
// This is supposed to select the block that I want, but I think the
// problem lies somewhere in the following 6 lines of code
// =================================================================
objNode = objSource.SelectSingleNode("site/content[page='#c#']");
objStyle=CreateObject("COM", "Microsoft.XMLDOM", "INPROC");
objStyle.async = "false";
styleReturn = objStyle.load("#STYLE#");
styleRoot = objStyle.documentElement;
xsloutput = objNode.transformNode(styleRoot);
// =================================================================
// =================================================================
xslcontent=#xsloutput#;
</cfscript>
<cfoutput>#xslcontent#</cfoutput>
=====================================
This is my XSL Code:
=====================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<table>
<xsl:for-each select="site/content">
<tr>
<td class="body" valign="top">
<xsl:value-of select="textblob"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
=====================================
This is the XML Document Structure:
=====================================
<?xml version="1.0"?>
<site>
<content id="company">
<page>company</page>
<textblob>
This will be site content for the company page.
</textblob>
</content>
<content id="services">
<page>services</page>
<textblob>
This will be site content for the services page.
</textblob>
</content>
</site>
THANKS FOR THE HELP!!!
Joshua Miller
Web Development::Programming
Eagle Technologies Group, Inc.
www.eagletgi.com
[EMAIL PROTECTED]
-----------------------+
cf-xml mailing list
[EMAIL PROTECTED]
http://torchbox.com/xml