Ive looked at the examples you directed me to but Im still unclear.
I'll give an example of the type of thing Im trying to do and perhaps you
could tell me what I need to do to get my data displayed on a web page (and
possibly saved as a new xml file).
When I browse to webform1.aspx I would like to display the output from my
stored procedure TestXML using the xsl file NW.xsl and saved as a file
OutputDDMMYYYY.xml in the web directory.
Thanks in advance
I have a xsl file called NW.xsl
====================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each select="ROOT/CU">
<tr>
<td colspan="2"><xsl:value-of select="CU_CN"/></td>
</tr>
<xsl:for-each select="ORD">
<tr>
<td><xsl:value-of select="ORD_ID"/></td>
<td><xsl:value-of select="ORD_DATE"/></td>
</tr>
<xsl:for-each select="OD">
<tr>
<td><xsl:value-of select="OD_UP"/></td>
<td><xsl:value-of select="OD_QTY"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
====================
I have created a stored procedure called TestXML
==================================
SELECT
dbo.Customers.CompanyName,
dbo.Orders.OrderID,
dbo.Orders.OrderDate,
dbo.[Order Details].UnitPrice,
dbo.[Order Details].Quantity,
dbo.Products.ProductName,
dbo.Products.QuantityPerUnit
FROM
dbo.Customers INNER JOIN
dbo.Orders ON dbo.Customers.CustomerID = dbo.Orders.CustomerID INNER JOIN
dbo.[Order Details] ON dbo.Orders.OrderID = dbo.[Order Details].OrderID
INNER JOIN
dbo.Products ON dbo.[Order Details].ProductID = dbo.Products.ProductID
for xml auto, elements
==================================
On my page webform1.aspx with the following function GetData
that gets called on Form_Load
============================================
Function GetData() As XPathDocument ' XmlReader
Dim SqlConnection1 As System.Data.SqlClient.SqlConnection
Dim SqlCommand1 As System.Data.SqlClient.SqlCommand
SqlConnection1 = New System.Data.SqlClient.SqlConnection
SqlCommand1 = New System.Data.SqlClient.SqlCommand
SqlConnection1.ConnectionString = "user id=WebUser;data
source=TERRY;initial catalog=Northwind"
SqlConnection1.Open()
SqlCommand1.CommandText = "TestXML"
SqlCommand1.CommandType = System.Data.CommandType.StoredProcedure
SqlCommand1.Connection = SqlConnection1
Dim o As XmlReader = SqlCommand1.ExecuteXmlReader
'not sure what to do here
End Function
"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:ebHfLM1fGHA.1456@TK2MSFTNGP04.phx.gbl...[color=blue]
>
>
> Terry Holland wrote:
>[color=green]
>> I have an asp.net (1.1) application that connects to a SQL server 2000
>> db. I have a stored procedure in my db that out puts data in xml format.
>> What I need to be able to do is display that xml that I retrieve from my
>> stored proc and display it in a web page formatted as I want. I have
>> managed to get my xml to display as I wish if I manually run my stored
>> proc in QA and copy the xml into notepad and save it as Test.xml. I
>> reference my xsl file in this xml file and when I view this file in IE it
>> displays as I want it to. What I need to know is how to do this
>> programmatically. I am able to get my xml data from the db. I just need
>> help with transferring that data into a page that I can display.[/color]
>
> ASP.NET has an XML control that allows you to apply a transformation, see
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsXmlClassTopic.asp>
>
> I am not sure however it is well suited to help you with displaying the
> query result. You might simply write the code for the transformation
> yourself creating an XslTransform instance
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXslXslTransformClassTopic.asp>
> and using its Transform method.
> The input for the Transform method could be an XPathDocument over an
> XmlReader you get from executing the query
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlCommandClassExecuteXmlR eaderTopic.asp>
>
>
> --
>
> Martin Honnen --- MVP XML
>
http://JavaScript.FAQTs.com/[/color]