Transfrom Memory XML and send output to client

S

Skyruner2

hi,
I want to load an XML, and XSL file and then send the transformed XML
to the
client browser. i have tried this:

//the classes
public abstract class XMLWorker
{
protected XmlDocument xmlDoc = new XmlDocument();
protected XMLWorker()
{
}
}
public sealed class XMLPageCore : XMLWorker
{
public XMLPageCore(string Path2BaseXML)
{
xmlDoc.Load(Path2BaseXML);
}

public void Deploy(string XSLTPath,System.IO.Stream Stream)
{
System.Xml.Xsl.XslCompiledTransform ledTransform XSLT = new
System.Xml.Xsl.XslCompiledTransform(); default: XSLT.Load(XSLTPath);
XSLT.Transform(xmlDoc.DocumentElement,null,Stream);
}
}

//The call

XMLPageCore test = new
XMLPageCore(Server.MapPath("test/XMLFile.xml"));


test.Deploy(false,Server.MapPath("test/XSLTFile.xsl"),Response.OutputStream);
am);



on the page though, i get the XML Processing Instructions <?.. and then
all
of the xml content w/o any tags or whitespace. but if i use the
overload of
xslt.transform that will take the input and output files as parameter (
XSLT.Transform("test/XMLFile.xml","test/XSLTFile.xsl"); ), it works
just
fine.

I have also tried it with Stream as System.IO.TextWriter and thus
passing
Response.Output and not Response.OutputStream .


Thanks :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top