XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
David BrandenburgSubject: Net 2.0 and Stylus Studio.
Author: David Brandenburg
Date: 11 Oct 2006 10:51 PM
I have created in Stylus Studio a Xslt using the .Net 2.0 parser to transform a xml file to text. Using Stylus studio it formats exactly as I want it. When I transform using .Net 2.0 C# I get a different result. I am using the same file with both Stylus Studio and C#. I think it has to do with how I am reading the Xml document or loading the Xslt file. I have seen that Stylus Studio uses the class XslCompiledTransform. Am I missing something or should the C# transform the same as Stylus Studio? The following is the transformation I am using in C#

XmlTextReader tr = new XmlTextReader(XmlFile);
XPathDocument xPathDocument = new XPathDocument(XmlFile);
XmlTextReader tr22 = new XmlTextReader(xStyleSheet);
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(tr22)
StreamWriter sw = new StreamWriter(OutputLocation,false);
xslt.Transform(xPathDocument, null, sw);

Postnext
Ivan PedruzziSubject: Net 2.0 and Stylus Studio.
Author: Ivan Pedruzzi
Date: 11 Oct 2006 11:13 PM
David,

In order to help you we need to see the XML+XSLT and the result created programmatically.


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
David BrandenburgSubject: Net 2.0 and Stylus Studio.
Author: David Brandenburg
Date: 11 Oct 2006 11:25 PM
Attached are the Xml and output text from both c# and SS and the xslt.


DocumentJobsTest.xml


DocumentCopyofBeyond.xsl


UnknownOutputFromSS.txt


UnknownOutputFromC.txt

Postnext
Ivan PedruzziSubject: Net 2.0 and Stylus Studio.
Author: Ivan Pedruzzi
Date: 12 Oct 2006 12:02 AM
David,

it seems like whitespace problem, try to use an XmlReader to load the XML input.


XmlReaderSettings srcReaderSettings = new XmlReaderSettings();
XmlReader xsltReader = XmlReader.Create(<XSLT URL>,srcReaderSettings);
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(xsltReader, new XsltSettings(true, true), new XmlUrlResolver());
XmlReader xmlReader = XmlReader.Create(<XML URL>, srcReaderSettings);
FileStream fileStream = new FileStream(<OUTPUT URL>, FileMode.Truncate);
xslt.Transform(xmlReader, null, fileStream);


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
David BrandenburgSubject: Net 2.0 and Stylus Studio.
Author: David Brandenburg
Date: 12 Oct 2006 12:13 AM
That resolved the issue.

Thanks,
Ivan

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.