Page 1 of 1

ASP / XSL

Posted: Thu Jul 27, 2006 12:25 pm
by Danjo_Hart
I have a master XSL-T sheet I am trying to dynamically update using ASP variables passed to it. I am only getting so far and would like some help.

The xml data looks like:
<?xml version="1.0" encoding="utf-8"?>
<techTree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<techSkill skillId="AScript" tType="script">
<techIntro/>
<skillName pathActive="No" pathId="/skills/actionscript/actionscript_content.asp">
ActionScript
</skillName>
<skillLevel>
Beginner
</skillLevel>
<firstUsedDate>
2003
</firstUsedDate>
<lastUsed>
Currently
</lastUsed>
<skillYears>
2 years
</skillYears>
<interestLevel>
5
</interestLevel>
</techSkill>

The XSL is here: http://www.jojowebdesign.com/xslt/technology.xsl and at the top you will see:
<xsl:param name="sortBy" select="'skillYears'"/>
<xsl:param name="strXPath" select="//techSkill"/>
-
<xsl:template match="/">
<xsl:value-of select="count(//techSkill)"/>
<xsl:text> Current Technical Skills Returned.</xsl:text>
-
<div style="float: left; padding: 0px 2px; background: #0CF;">
-
<xsl:apply-templates select="$strXPath">
<xsl:sort select="*[name()=$sortBy]" order="descending"/>
</xsl:apply-templates>
</div>
</xsl:template>


My ASP is where I am having trouble passing a variable to the XSL-T. What do I need to do?
:
<%
Dim xslStyleFile, xmlQuery, objNodes

Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument")
Set xslStyleFile = Server.CreateObject("MSXML2.DOMDocument")

xslStyleFile.setProperty "SelectionLanguage", "XPath"

xmlDoc.async = False
xslStyleFile.async = False

xmlDoc.load Server.MapPath("/xmldata/technology.xml")

' Build the XPath query
xmlQuery = "//techSkill/skillName"
objNodes = xmlDoc.selectNodes(xmlQuery)

xslStyleFile.load Server.MapPath("/xslt/technology.xsl")

Response.Write xmlDoc.TransformNode(xslStyleFile)
Set xmlDoc = Nothing
Set xslStyleFile = Nothing
%>

I am crashing at:
objNodes = xmlDoc.selectNodes(xmlQuery)

But I really need more help in prepping the staging area.. Ideas?