I changed to using a stream. That worked fine for the
first transformation. But the succeeding transformation,
which is supposed to output HTML tags is failing with the
same error ("There are multiple root elements in the
output XML.").
All the HTML tags fall under one root node which is a div
tag.
Perhaps I'm not understanding what a root element is.
One thing I do notice is that the html is similar to this:
<div>
<table>
<tr>
<td>Test</td>
</tr>
</table>
<table>
<tr>
<td>Test</td>
</tr>
</table>
</div>
So there are children under the DIV element who are on the
same level (ie. table tags).
Any help would be very appreciated.
[quoted text, click to view] >-----Original Message-----
>B Johnson wrote:
>
>> I am trying to transform an xml document using an xsl
>> document into HTML.
>>
>> I am getting the following error:
>>
>> "There are multiple root elements in the output XML."
>
>Sounds like you are transforming to XmlWriter or
XmlReader, both of which
>ensure XML document is wellformed (aka has the only root
element). Transform
>to TextWriter or directly to Stream instead.
>Alternatively fix up your stylesheet, because multiple
root elements in html
>is not good thing either.
>--
>Oleg Tkachenko
>
http://www.tkachenko.com/blog >Multiconn Technologies, Israel
>
>.
[quoted text, click to view] B Johnson wrote:
> I am trying to transform an xml document using an xsl
> document into HTML.
>
> I am getting the following error:
>
> "There are multiple root elements in the output XML."
Sounds like you are transforming to XmlWriter or XmlReader, both of which
ensure XML document is wellformed (aka has the only root element). Transform
to TextWriter or directly to Stream instead.
Alternatively fix up your stylesheet, because multiple root elements in html
is not good thing either.
--
Oleg Tkachenko
http://www.tkachenko.com/blog Multiconn Technologies, Israel
[quoted text, click to view] B Johnson wrote:
> I changed to using a stream. That worked fine for the
> first transformation. But the succeeding transformation,
> which is supposed to output HTML tags is failing with the
> same error ("There are multiple root elements in the
> output XML.").
What's "succeeding transformation"?
Above exception is thrown by XSLT engine when outputted document has
more than one root element (outermost element) and:
1) output method is xml, and
2) you have either doctype-system="ddd" or standalone="yes"
--
Oleg Tkachenko
http://www.tkachenko.com/blog Multiconn Technologies, Israel