Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extra crap after stylesheet
Message
Information générale
Forum:
Internet
Catégorie:
XLST
Titre:
Extra crap after stylesheet
Divers
Thread ID:
00680248
Message ID:
00680248
Vues:
52
Anyone how to stop the transform to not put the extra characters in the resulting html when you have written to the response before transforming your xml and putting the output to response. It seems to me to be a charSet problem as the transform output stream is always in unicode. It only happens if you put normal text (like the html tag) before the stream output.

Suggestions?

Try this:
<html>
<%
cHTML = ""
cXML = "<TEST><NODE>myNode</NODE></TEST>"
cXSL = "<?xml version='1.0'?><xsl:stylesheet version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform""><xsl:output method=""xml"" indent=""yes""/><xsl:template match=""/""><span>done</span></xsl:template></xsl:stylesheet>"

SET XMLDoc=server.CreateObject("msxml2.domdocument.4.0")
XMLDoc.async = false

if XMLDoc.loadxml(cXML) then
	SET xslt = server.CreateObject("Msxml2.XSLTemplate.4.0")
	SET XSLDoc=server.CreateObject("msxml2.FreeThreadedDOMDocument.4.0")
	XSLDoc.async = false
	SSLoaded = XSLDoc.loadXML(cXSL)

	if SSLoaded then
		xslt.stylesheet = xslDoc
		SET xslProc = xslt.createprocessor()
		xslProc.input = XMLDoc
		xslProc.output = response 
		
		xslProc.transform			
	else
		cHTML = "Error Opening Style Sheet"
	end if
else
	cHTML = "Error Collecting Data"
end if
if len(cHTML)>0 then
	Response.Write(cHTML)
end if
%>
</html>
Bill Mittenzwey
Répondre
Fil
Voir

Click here to load this message in the networking platform