all groups > dotnet xml > july 2005 >
You're in the

dotnet xml

group:

How to perform xsl Transformation in Memory



How to perform xsl Transformation in Memory kuangzhang NO[at]SPAM gmail.com
7/25/2005 8:01:14 AM
dotnet xml: I have an database that stores both the XSL and XML data and would like
to transform the two upon request from the user.

I have created a aspx page that takes the XMLDocID and XSLDocID as
parameter.

private void Page_Load(object sender, System.EventArgs e)
{
string XML = dsXML.Table[0].Rows[0]["XML"].ToString();
string XML = dsXSL.Table[0].Rows[0]["XSL"].ToString();
string Result = ProcessTrans(XML, XSL);
}

Private string ProcessTrans(string XML, XSL)
{
//Not sure how to do this effectively
}

Anyhelp would be helpful.
Thanks
Re: How to perform xsl Transformation in Memory kuangzhang NO[at]SPAM gmail.com
7/25/2005 2:36:23 PM
Loading the XML doc is not a problem. Its loading the stylesheet that
is. I have tried many way to do this and all came up with road blocks.
the problem is xsltransform object does not load string but only load
a hard code path. Since all the xsl and xml are in memory its quite
difficult to do. Do you have the entire a function written that will
do this? If so please posted it.
Re: How to perform xsl Transformation in Memory intrader
7/25/2005 9:30:17 PM
[quoted text, click to view]
I would first load the two XMLs via LoadDocument. Then you can apply
Transform.
Re: How to perform xsl Transformation in Memory Pascal Schmitt
7/26/2005 12:03:02 AM
[quoted text, click to view]


Just use an other overload of the XslTransform.Load-Method:

transform.Load( new XmlTextReader( new StringReader( myXslString ) );

should work.


--
Re: How to perform xsl Transformation in Memory intrader
7/27/2005 12:00:00 AM
[quoted text, click to view]
AddThis Social Bookmark Button