A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: server side xml transform thru xsl using asp

  1. #1
    Member
    Join Date
    May 2000
    Posts
    30
    <i>Sorry, there's not really a Flash side to this one, but it's interesting all the same and I guarantee you'll find the technique useful - even more so if we can get a solution...</i>

    <b>HISTORY</b>

    I have been using the following asp script ('transform.asp') to transform XML ('data.xml') thru XSL (stylesheet.xsl') into HTML on the server so as to avoid compatibility issues with non-XML supportive browsers:

    'Load the XML
    set xml = Server.CreateObject("Microsoft.XMLDOM")
    xml.async = false
    xml.load(Server.MapPath("data.xml"))

    'Load the XSL
    set xsl = Server.CreateObject("Microsoft.XMLDOM")
    xsl.async = false
    xsl.load(Server.MapPath("stylesheet.xsl"))

    'Transform the file
    Response.Write(xml.transformNode(xsl))


    This works fine by returning standard html when specifying the namespace in the xsl stylesheet as follows:


    <.x.s.l:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">


    BUT, I'm now attempting to use the newer and recommended w3c xsl standard to use <.x.s.l:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">. I have found articles re this on the Microsoft website at http://msdn.microsoft.com/library/de...k/xmlt7k18.htm which state that the CreateObject command should reference "Msxml2.DOMDocument". So I have updated my asp as follows:

    'Load the XML
    set xml = Server.CreateObject("Msxml2.DOMDocument")
    xml.async = false
    xml.load(Server.MapPath("data.xml"))

    'Load the XSL
    set xsl = Server.CreateObject("Msxml2.DOMDocument")
    xsl.async = false
    xsl.load(Server.MapPath("stylesheet.xsl"))

    'Transform the file
    Response.Write(xml.transformNode(xsl))

    However this gives me the following error:

    Server object error 'ASP 0177 : 800401f3'

    Server.CreateObject Failed

    xml/transform.asp, line 3

    Invalid class string

    <b>QUESTIONS</b>

    1. Have I overlooked something obvious?
    2. Is it something to do with the version of the MSXML parser running on the server?
    3. Does anyone have any suggestions on the asp?

    ps I had to edit this a few times to get the scripts to display - pls ignore the periods '.' in the xsl statement.
    [Edited by Mack on 05-25-2001 at 08:14 AM]

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Posts
    10
    [QUOTE]
    'Load the XML
    set xml = Server.CreateObject("Msxml2.DOMDocument")
    xml.async = false
    xml.load(Server.MapPath("data.xml"))

    'Load the XSL
    set xsl = Server.CreateObject("Msxml2.DOMDocument")

    However this gives me the following error:
    Server object error 'ASP 0177 : 800401f3'
    Server.CreateObject Failed
    xml/transform.asp, line 3
    Invalid class string
    [QUOTE]


    Hey are you shure the msxml2 is installed on your Server?! I think not. I think thats the reason, because
    Server.CreateObject Failed
    i had problem like this and i must install a update.

    A other way.. check http://www.apache.org there you found wunderfull Servers that can XML and XSL to generate HTML..
    best
    stefan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center