i have an program where i'm extracting xml from comments in a vbs file and then i need to output an html file using an xsl file for the transformation. to that end, i have code of...
my problem is that the output html tags are getting collapsed, which while appropriate for xml, is not appropriate for html and results in page display problems. for example, part of the output should include
however, the actual output looks like
i can fix this by putting in a hard-coded space or new line character, but it seems like i should be able to somehow direct the xmlwriter to not collapse end tags. i know that the xmlwritersettings class has a property for output method, but it appears to be read-only!? how do i tell the xmlwriter to output html?
thanks,
glenn
Code:
XslCompiledTransform transformer = new XslCompiledTransform();
transformer.Load(xslFile);
string xmlContent = ParseXMLFromFile(vbsFile);
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(xmlContent);
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
settings.Indent = true;
transformer.Transform(xdoc.CreateNavigator(), XmlWriter.Create(htmlFile, settings));
my problem is that the output html tags are getting collapsed, which while appropriate for xml, is not appropriate for html and results in page display problems. for example, part of the output should include
Code:
<script type="text/javascript" src="source.js"></script>
however, the actual output looks like
Code:
<script type="text/javascript" src="source.js" />
i can fix this by putting in a hard-coded space or new line character, but it seems like i should be able to somehow direct the xmlwriter to not collapse end tags. i know that the xmlwritersettings class has a property for output method, but it appears to be read-only!? how do i tell the xmlwriter to output html?
thanks,
glenn