Combine and replace element attribute with combination from different elements

33 views
Skip to first unread message

Greg Shirey

unread,
Mar 20, 2012, 5:36:05 PM3/20/12
to XSLT
Hello,

I have an xslt where I am combining multiple xml files in to one xml
file with the following:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>

<!-- processes all *nodes* by copying them, and can be overridden for
individual elements, attributes, comments, processing instructions, or
text nodes -->

<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

<xsl:template match="/*">
<stringDefinition>
<helpList>
<xsl:for-each select="file">
<xsl:apply-templates
select="document(.)/*//helpList/HelpText">
<xsl:with-param name="file" select="."/>
</xsl:apply-templates>
</xsl:for-each>
</helpList>
<errorList>
<xsl:for-each select="file">
<xsl:apply-templates
select="document(.)/*//errorList/errorMsg">
<xsl:with-param name="file" select="."/>
</xsl:apply-templates>
</xsl:for-each>
</errorList>
<warnList>
<xsl:for-each select="file">
<xsl:apply-templates
select="document(.)/*//warnList/warnMsg">
<xsl:with-param name="file" select="."/>
</xsl:apply-templates>
</xsl:for-each>
</warnList>
<infoList>
<xsl:for-each select="file">
<xsl:apply-templates
select="document(.)/*//infoList/infoMsg">
<xsl:with-param name="file" select="."/>
</xsl:apply-templates>
</xsl:for-each>
</infoList>
</stringDefinition>
</xsl:template>
</xsl:stylesheet>

I would like to take the value of an element named "subSystem" which
is under the root node "stringDefinition" and prepend it to each of my
errorList/errorMsg id params as all the documents are being combined.
How can I do this?

Greg Shirey

unread,
Mar 22, 2012, 3:58:32 PM3/22/12
to XSLT
Bump. I haven't gotten a reply to this but I really need to figure
this out. I just want to replace the value of all of a certain node
with the combination of its value and another node's.
Reply all
Reply to author
Forward
0 new messages