I have a XML file with belonging XSL file. Opening the XML file in IE7 works
just fine. But when using the following code I get the error message:
"Attribute and namespace nodes cannot be added to the parent element after a
text, comment, pi, or sub-element node has already been added."
XPathNavigator nav =
xml_document.DocumentElement.CreateNavigator();
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(xsl_document_location);
xslt.Transform(nav, null, output_stream);
My XSL code contains some portions of code like this:
<xsl:element name="img">
<xsl:attribute name="class">drawing</xsl:attribute>
<xsl:attribute name="width">100%</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="Folder" />
<xsl:text disable-output-escaping="yes">/</xsl:text>
<xsl:value-of select="Filename" />
</xsl:attribute>
</xsl:element>
A thread I found
(http://forums.microsoft.com/MSDN/Sho...27581&SiteID=1) says
that attribute nodes should be created before element nodes. This is find
very strange since the attribute is a part of the element, not vice versa.
Anyone?