Guest_imported
New member
- Jan 1, 1970
- 0
hi. I have the following problem with xslt when doing xml to xml transformations. In some cases I want to copy an element and it's attributes exept one -which should get a fixed value- to the output tree. What I do to achieve this, you can see in this example code snippet:
<xsl:template name="tname">
<element_x att1="{@att1}" att2="{@att2}" att3="fixed"/>
</xsl:template>
It works fine. But my question is, whether it is possible somehow, to say in xsl: copy the element and all atrributes to the output, except the attribute, of name att3 and give a fixed value to it. (This is because not all of my "element_x" elements have the same attributes, and because everytime i add a new feature and therefore add a new attribute to element_x i have to search and replace in all my xsl which works with element_x)
(sorry for my bad english and thanks in advance)
<xsl:template name="tname">
<element_x att1="{@att1}" att2="{@att2}" att3="fixed"/>
</xsl:template>
It works fine. But my question is, whether it is possible somehow, to say in xsl: copy the element and all atrributes to the output, except the attribute, of name att3 and give a fixed value to it. (This is because not all of my "element_x" elements have the same attributes, and because everytime i add a new feature and therefore add a new attribute to element_x i have to search and replace in all my xsl which works with element_x)
(sorry for my bad english and thanks in advance)