Friday, January 13, 2012

format in xslt template

while we create xslt tempate to transform xml file,I find that the transform will not delete all returns we put in template,if we format the xslt file,it will automatically add returns in some tags
which will cause the return go to end transformed files

<Comments>~<xsl:value-of select="normalize-space(Comments)"/>~</Comments>

after format will look like this

<Comments>~
<xsl:value-of select="normalize-space(Comments)"/>~
</Comments>

this will cause two returns after sign ~ to end file,which is not correct.
wrong data will be

<Comments>~
car durty outside /~
</Comments>

but we expect
<Comments>~car durty outside /~</Comments>

No comments:

Post a Comment