Click to See Complete Forum and Search --> : XML to XML with XSLT Emergency - Please Help!!!


mizwhite
02-18-2004, 11:24 AM
I am using a SQL Server stored procedure with an XML template to generate an XML file. This is working fine. However, I need to transform the generated XML to XML (need to re-arrange the xml so it can be validated against our stars.xsd schema) and this is where I am having problems.

I have linked the XSL stylesheet to my XML document using the standard <?xml-stylesheet type="text/xml" href="case.xsl"?> and within my XSL I have included <xsl:output method="xml" indent="yes" encoding="utf-8"/>. When I look at my XML document, its still in an untransformed state as if I had not even applied the XSL! No errors are generated, just left with XML that is not being transformed by the XSL stylesheet.

My code is attached in the Zip.

I would appreciate any help received!

TIA,

Frustrated SQL Chick

Khalid Ali
02-18-2004, 08:37 PM
are yuo using a proper xsl/xml processor?
because only a processor will out put a new file.

mizwhite
02-19-2004, 04:10 AM
...

mizwhite
02-19-2004, 04:26 AM
I've just downloaded the SAXON processor. My only concern now is that SQL is generating my XML files and to create the files, the data is queried and simply passed to an XML template which generates the file and stores it in a folder for our clients to download. Is it possible to use a processor to transform the XML then store the transformed documents in a folder? Seems to me that I need somewhat of a client side processor or I need to rethink my solution entirely?

TIA

Denise

mizwhite
02-19-2004, 04:58 AM
Further, FYI - I am also using Internet Explorer 6.0 which I thought supported the current XSLT W3C recommendations? If that is the case why is SAXON or any other processor needed to transform the documents?

Khalid Ali
02-19-2004, 06:50 AM
Originally posted by mizwhite
....why is SAXON or any other processor needed to transform the documents?
Interesting question.

Here is what should work.
You have an xml file you apply xsl/xslt file to it using a processor(the built in processors with IE and NS) will only process xsl and display xml file, not out put as independent files)
The processor then spit out a new file depending upon the xsl out file format.

Now I a not sure what your database can do in this situation. If you have a way to use some built in processor in the db,you might be able to do that from there....
If you can't find answer until weekend,I'll see if i can run these files on my machine and get teh required results

Hp108
03-13-2004, 07:22 AM
I may be wrong in understanding the problem, but this is what i understood...
You have a query that retrieves xml data from SQLServer, and this data needs to be in a different xml format which should then be persisted in a folder to be accessibe by your clients.

If this is correct, then after retrieving the original xml (you have a stream), and you push that stream through an xsl processor to receive a formatted stream (new xml), and then all you have to do is persist it to whatever folder you want....
If I am in the right track, then I would elaborate more if you want me to...let me know. Good luck.

paps
03-18-2004, 04:10 PM
what u could do is write a bit of script which uses XMLDOM to apply the stylesheet to transform ur XML and save the ouput as another file using FileSystemObject. This is possible cause XMLDOM output would be a string.

HTH