![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - "root element missing" after transforming into memorystream >Thread Next - Re: "root element missing" after transforming into memorystream Re: "root element missing" after transforming into memorystreamTo: NULL Date: 12/28/2007 7:00:00 PM
kevin wrote:
> using .net 2.0
>
> I get this error when calling DataSet.ReadXml(stream). I am passing a
> memorystream that was passed to XslCompiledTransformer.Transform(). The
> resulting stream has an unprintable character just before the xml declaration.
Which error exactly do you get? If the error is "root element is
missing" then you can easily fix that by setting Position to 0 after the
transformation but before you load into the data set e.g.
using (transformedXml = new MemoryStream() )
{
//do the transformation and output into the
memorystream
xslTransformer.Transform(xml, null,
transformedXml);
transformedXml.Position = 0;
If there are problems with characters before the XML declaration then
that can only be a BOM and that should not pose any problems. So try
setting Position to 0 on the memory stream before you pass it to the
ReadXml method. If you still have problems then post the exact error
message.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
