J
Jeff Gutsell
I'm trying to develop a system for transforming an xml file into two
different html pages via VBscript. My code fails but does not
generate any error messages. Here's my VBscript:
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async=false
xmlDoc.load(Server.MapPath("toc.xml"))
set xslDoc = Server.CreateObject("Microsoft.XMLDOM")
xslDoc.async = false
xslDoc.load(Server.MapPath("toc.xsl"))
If xmlDoc.parseError.errorCode = 0 Then
Response.Write(xmlDoc.transformNode(xslDoc))
Else
response.write("Your data was not found.")
End If
When IE displays the web page that contains the above script, the only
thing in the html is "<?xml version="1.0" encoding="UTF-16"?><?xml
version="1.0" encoding="UTF-16"?>."
The strange thing is that my xml files use different encoding.
I've validated both toc.xml and toc.xsl, but could there still be a
problem there? I'm not sure what to try.
Here's the DTC from toc.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE toc [
<!ELEMENT toc (section+, page*)>
<!ELEMENT section (sectitle,page+,section*)>
<!ELEMENT sectitle (#PCDATA)>
<!ELEMENT page (pagurl,pagtitle)>
<!ELEMENT pagurl (#PCDATA)>
<!ELEMENT pagtitle (#PCDATA)>
]>
<toc>
....
Hope this helps.
BTW, if you feeel that this should be posted in a vbscript forum, my
apologies in advance.
Jeff
different html pages via VBscript. My code fails but does not
generate any error messages. Here's my VBscript:
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async=false
xmlDoc.load(Server.MapPath("toc.xml"))
set xslDoc = Server.CreateObject("Microsoft.XMLDOM")
xslDoc.async = false
xslDoc.load(Server.MapPath("toc.xsl"))
If xmlDoc.parseError.errorCode = 0 Then
Response.Write(xmlDoc.transformNode(xslDoc))
Else
response.write("Your data was not found.")
End If
When IE displays the web page that contains the above script, the only
thing in the html is "<?xml version="1.0" encoding="UTF-16"?><?xml
version="1.0" encoding="UTF-16"?>."
The strange thing is that my xml files use different encoding.
I've validated both toc.xml and toc.xsl, but could there still be a
problem there? I'm not sure what to try.
Here's the DTC from toc.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE toc [
<!ELEMENT toc (section+, page*)>
<!ELEMENT section (sectitle,page+,section*)>
<!ELEMENT sectitle (#PCDATA)>
<!ELEMENT page (pagurl,pagtitle)>
<!ELEMENT pagurl (#PCDATA)>
<!ELEMENT pagtitle (#PCDATA)>
]>
<toc>
....
Hope this helps.
BTW, if you feeel that this should be posted in a vbscript forum, my
apologies in advance.
Jeff