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.Do cumentElement.C reateNavigator( );
XslCompiledTran sform xslt = new XslCompiledTran sform();
xslt.Load(xsl_d ocument_locatio n);
xslt.Transform( nav, null, output_stream);
My XSL code contains some portions of code like this:
<xsl:element name="img">
<xsl:attribut e name="class">dr awing</xsl:attribute>
<xsl:attribut e name="width">10 0%</xsl:attribute>
<xsl:attribut e name="src">
<xsl:value-of select="Folder" />
<xsl:text disable-output-escaping="yes">/</xsl:text>
<xsl:value-of select="Filenam e" />
</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?
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.Do cumentElement.C reateNavigator( );
XslCompiledTran sform xslt = new XslCompiledTran sform();
xslt.Load(xsl_d ocument_locatio n);
xslt.Transform( nav, null, output_stream);
My XSL code contains some portions of code like this:
<xsl:element name="img">
<xsl:attribut e name="class">dr awing</xsl:attribute>
<xsl:attribut e name="width">10 0%</xsl:attribute>
<xsl:attribut e name="src">
<xsl:value-of select="Folder" />
<xsl:text disable-output-escaping="yes">/</xsl:text>
<xsl:value-of select="Filenam e" />
</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?
Comment