[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: transforming xml from db

  • From: Michael Rys <mrys@m...>
  • To: Pepe Ortiz <portiz@b...>, xml-dev@l...
  • Date: Mon, 09 Apr 2001 08:57:04 -0700

xml to db
You are falling into the WinInet on server bug by trying to load the XML
via HTTP inside an active server page (there are several KB articles on
that on msdn.microsoft.com and MSXML 3.0 ships a ServerXMLHTTP object
that provides an alternative. 

If you are using SQLServer 2000 and ADO2.6 (that is part of the default
MDAC client), use the ADO stream object to get the XML from the database
and use the XSL transformation properties.

Best regards
Michael

> -----Original Message-----
> From: Pepe Ortiz [mailto:portiz@b...]
> Sent: Monday, April 09, 2001 8:33 AM
> To: xml-dev@l...
> Subject: 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
> 
> 
> ------------------------------------------------------------------
> The xml-dev list is sponsored by XML.org, an initiative of OASIS
> <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To unsubscribe from this elist send a message with the single word
> "unsubscribe" in the body to: xml-dev-request@l...
> 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.