function TransformDocument(srcXML, srcXSL)
Dim sourceFile, styleFile, source 'the xsl file
path styleFile = srcXSL set source =
Server.CreateObject("MSXML2.DOMDocument.4.0") source.async =
false source.loadXML srcXML Set objRoot =
source.documentElement Set objField =
objRoot.selectSingleNode("//selected-template-id") IncTemplatePath =
"../../../skins/" + objField.TEXT + "/Templates/template.xsl" Set
objRoot = Nothing 'Get The Style Object set style
= Server.CreateObject("MSXML2.DOMDocument.4.0") style.async =
false style.setProperty
"SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"
style.load styleFile Set objRoot1 =
style.documentElement Set objField1 =
style.selectSingleNode("/xsl:stylesheet/xsl:include[@href='INCLUDEPATH1']")
objField1.setAttribute "href", IncTemplatePath
IncIncludePath = "../../../skins/" + objField.TEXT +
"/Templates/includes.xsl" Set objField2 =
style.selectSingleNode("/xsl:stylesheet/xsl:include[@href='INCLUDEPATH2']")
objField2.setAttribute "href", IncIncludePath Set objField1
= Nothing Set objField2 = Nothing 'Error
Handaling if (source.parseError.errorCode <> 0)
then result =
reportParseError(source.parseError) elseif (style.parseError.errorCode
<> 0) then result =
reportParseError(style.parseError) else on error
resume next result = source.transformNode(style)
if (err.number<>0) then result =
reportRuntimeError(exception) end if end
if 'Make the result TransformDocument = result End
Function
my XSL file is this
<?xml
version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"> <xsl:include
href="INCLUDEPATH1"/> <xsl:include
href="INCLUDEPATH2"/> <xsl:template
match="query-data"> <table
align="center" cellpadding="0" cellspacing="1" width="100%"
border="0"> <tr class="looplistingDark">
<td width="30%" class="contents">MX First
Priority : </td> <!-- here is
my design
--> </td> </tr> </table> </xsl:template> </xsl:stylesheet>
it was running fine .. i refreshed my OS .. i dont
know what does it lacks now .. this is giving me error now .. i updated my xml
parser but still jetting this error
Microsoft VBScript runtime error '800a01a8'
Object required: 'objField1'
/common/xmlfunctions.asp, line 161
Plz Help
|