Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: issue when transforming [Thread Next] Re: issue when transformingTo: NULL Date: 5/7/2008 10:50:00 AM Thanks for the feedback. It looks like the XmlTextWriter was doing something screwy when it encountered that. Duh!!! But after doing what you said it's looking good. Lance Johnson "Martin Honnen" <mahotrash@y...> wrote in message news:uewUGcFsIHA.2292@T...... > Lance Johnson wrote: >> We are currently using the XslCompiledTransform class to transform an xml >> file, but we're getting this strange a character with a hat over it (Â). >> When I look at the xsl the part that is causing this has something like >> this: >> <span> >> <xsl:text> </xsl:text> >> </span> > > Well the issue is perhaps not with the XSLT stylesheet but rather how you > look at or display the transformation result. The code below writes to a > HTML document. How do you display that document? > How does the xsl:output element in your stylesheet look? Does the HTML > document the stylesheet generates have a > <meta http-equiv="Content-Type" content="text/html; > charset=somecharset"> > element in the head? > > >> //create the output stream >> using (XmlTextWriter myWriter = new XmlTextWriter("output.html", null)) >> { >> using (XmlWriter xmlWriter = XmlWriter.Create(myWriter, >> trans.OutputSettings)) >> { >> //do the actual transform of Xml >> trans.Transform(doc, null, xmlWriter); >> } >> } > > Drop the outer XmlTextWriter, simply use > > using (XmlWriter xmlWriter = XmlWriter.Create("output.html", > trans.OutputSettings)) > { > //do the actual transform of Xml > trans.Transform(doc, null, xmlWriter); > } > > that way you ensure that the meta element in the HTML document that is > generated and the encoding of the document match. > > > -- > > Martin Honnen --- MVP XML > http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
