[quoted text, click to view] samadams_2006@yahoo.ca wrote:
[quoted text, click to view] > That worked, now it's gone to the statement:
>
> trans.Transform(dataDocument, other arguments)
>
> I've tried:
>
> trans.Transform(dataDocument, Server.MapPath("chapter8.xsl"))
>
> etc., etc.
>
> It doesn't like the dataDocument. It gives about 18 separate method
> calls, and this first parameter needs to be one of :
>
> XPathNavigator
> IXPathNavigable
I had hoped you had used the Transform method before and know what other
parameters you need. As for dataDocument, it is an XmlDataDocument which
implements IXPathNavigable so any Transform overload that takes an
IXPathNavigable as the first arguments will consume the dataDocument as
the first argument.
Assuming you have (with comments removed)
'trans = New XslTransform
'trans.Load(Server.MapPath("chapter8.xsl"))
as in your first post you have to decide what kind of transformation
result you want, if that is ASP.NET and you want to send the result of
the transformation to the user agent as the HTTP response then doing e.g.
trans.Transform(dataDocument, Nothing, Response.OutputStream, Nothing)
is one possible way (With ASP you should also send Response.ContentType
as needed if your stylesheet does not create HTML). And of course your
stylesheet chapter8.xsl that you load with XslTransform is crucial to
get any meaningful results, the DataSet/XmlDataDocument convert the
relational query result to XML but obviously if you want to write a
stylesheet to process that XML then you need to know how the XML looks.
So for a test not doing any transform but rather simply
Response.ContentType = "application/xml"
dataDocument.Save(Response.OutputStream)
to simply look in IE at the XML returned could help to enable you to
write a stylesheet.
--
Martin Honnen --- MVP XML