Menu

#5 Cannot add attributes after text nodes

latest_release
open
nobody
5
2005-02-14
2005-02-14
Lars Huttar
No

While running xslt2xforms on input.xml using Saxon, I
encountered the error:
F Cannot write an attribute when there is no open
start tag xform.xsl
file:/C:/temp/extract/xslt2xforms_0.7.6/xform.xsl 46:0

This is because line 46 in the template for
"xforms:textarea" contains the code
<div class="control"><textarea id="{generate-id(.)}"
xmlns="http://www.w3.org/2002/xforms">&#160;<xsl:copy-of
select="@*" /></textarea>
</div>

Note that the xsl:copy-of tries to copy attributes
after inserting a text node (&#160;). This would
generate non-well-formed XML. I think what was intended
would be to put the &#160; after the xsl:copy-of:

&lt;div class="control"&gt;&lt;textarea id="\{generate-id\(.\)\}"

xmlns="http://www.w3.org/2002/xforms"><xsl:copy-of
select="@*" />&#160;</textarea>
</div>

Lars

Discussion


Log in to post a comment.

MongoDB Logo MongoDB