OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

transforming xml from db



Hi there, its me again! I'm new to XML so bear with for a minute.

Here is another way of explaining my dilema ... well, I'm trying to find a
way of pulling a record from a sql server db which in its entire content is
a complete formed xml doc and display it in an *.asp along with a XSL
file???

Some people suggested to use the content type definition to "text/xml" ...
however I've not found the correct syntax for this line ... can anyone share
it with me?

I've seen several examples where this is done BUT with physically existing
files (like the function in the sample below) ... in my case I want to so
the same but with a pull/query of the actual XML from the db (in ms-sql)

====
sub TransformXMLtoHTML(sXMLFilename, sXSLFilename)
  dim objXMLDoc
  dim objXSLDoc

  'First, load the XML Document
  set objXMLDoc = Server.CreateObject("Microsoft.XMLDOM")
  objXMLDoc.async = false
  objXMLDoc.load(Server.MapPath(sXMLFilename))

  'Now Load the XSL Document
  set objXSLDoc = Server.CreateObject("Microsoft.XMLDOM")
  objXSLDoc.async = false
  objXSLDoc.load(Server.MapPath(sXSLFilename))

  ' Now simply transform the XML/XSL files into HTML
  Response.Write(objXMLDoc.transformNode(objXSLDoc))
end sub
====

My problem seems to be when assigning the result from the query to a
variable and trying to apply the XSL to it ... it just doesn't seem to work.
It just doesn't show anything at all.

I guess that what I need is to have something like this to work
====
objXMLDoc.loadxml(strXML)
====

So, could anyone tell me what am I doing wrong here?
Is there an example of something like this anywhere so I can see how is
done?

Cordially,
-Pepe Ortiz