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
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