RE: [xsl] Getting encoding error on svg output

Subject: RE: [xsl] Getting encoding error on svg output
From: Américo Albuquerque <aalbuquerque@xxxxxxxxxxxxxxxx>
Date: Sat, 17 May 2003 16:00:33 +0100
Hi

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Ragulf Pickaxe
> Sent: Thursday, May 15, 2003 8:49 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] Getting encoding error on svg output
> 
> 
> Thanks Américo but....
> 
> I tried your solution "call
> oXml.transformNodeToObject(oXsl,Response)" but 
> while I get no error doing this, but there is no output 
> either (page is 
> blanck). When I view the source code, I get, as the only 
> contents: <?xml version="1.0" encoding="UTF-16"?>
> 
> It seems to me that there is still error, but it is now
> hidden from the user 
> (me).
> 
> The above is also the contents that I get when using simple
> response.write(oXml.transform(oXsl)) - but here I get the 
> aforementioned 
> error.
> 
> I have only access to MS tools at the moment, but if anybody
> have access to 
> other transformation tools, and could try out the original 
> xml and xsl 
> files, and tell the result (if it works, and on which 
> software), I will be 
> very gratefull.

On your stylesheet.xsl wrap the <svg> element on a <xsl:template
match="/"><svg ...>...</svg></xsl:template> and it should work.

Here is the complete test.asp page with error report
<%@ Language=VBScript %>
<%
Response.ContentType = "image/svg-xml"
dim oXml, oXsl, error, errorText

set oXml = Server.CreateObject("MSXML2.DOMDocument")
oXml.async = false
set oXsl = Server.CreateObject("MSXML2.DOMDocument")
oXsl.async = false
error = false
errorText = ""
call oXml.load(Server.MapPath("source.xml"))
if oXml.parseError.errorCode<>0 then
 errorText = errorText & "<text x='0' y='1em'>Error: " &
oXml.parseError.errorCode & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='2em'>" & oXml.parseError.reason
& "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='3em'>Line: " &
oXml.parseError.line & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='4em'>Position: " &
oXml.parseError.linepos & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='5em'>Source: " &
oXml.parseError.srcText & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='6em'>URL: " &
oXml.parseError.url & "</text>" & vbcrlf
 error = true
end if
call oXsl.load(Server.MapPath("stylesheet.xsl"))
if oXsl.parseError.errorCode<>0 then
 errorText = errorText & "<text x='0' y='1em'>Error: " &
oXsl.parseError.errorCode & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='2em'>" & oXsl.parseError.reason
& "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='3em'>Line: " &
oXsl.parseError.line & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='4em'>Position: " &
oXsl.parseError.linepos & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='5em'>Source: " &
oXsl.parseError.srcText & "</text>" & vbcrlf
 errorText = errorText & "<text x='0' y='6em'>URL: " &
oXsl.parseError.url & "</text>" & vbcrlf
 error = true
end if
if error then
 Response.Write "<svg xmlns='http://www.w3.org/2000/svg'>"
 Response.Write errorText
 Response.Write "</svg>"
else
 if Request("type")="text" then
  Response.Write oXml.transformNode(oXsl)
 else
  call oXml.transformNodeToObject(oXsl,Response)
 end if
end if
%>

  Américo Albuquerque




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread