Reputation: 3
XML Data:
<ProcessData>
<OUTPUT>
<SourceAgent>Agent1</SourceAgent>
<DestinationAgent>Agent2</DestinationAgent>
</OUTPUT>
</ProcessData>
XSLT:
<sourceAgent QMgr="BSCMFT01" agent="'<xsl:value-of select="/ProcessData/OUTPUT/SourceAgent/text()"/>'"/>
<destinationAgent QMgr="BSCMFT01" agent="'<xsl:value-of select="/ProcessData/OUTPUT/DestinationAgent/text()"/>'"/>
Desired Output:
<sourceAgent QMgr="BSCMFT01" agent="Agent1"/>
<destinationAgent QMgr="BSCMFT01" agent="Agent2"/>
Error: The value of attribute "agent" associated with an element type "sourceAgent" must not contain the '<' character.
Summary:
Upvotes: 0
Views: 52
Reputation: 116982
Use either the xsl:attribute
instruction:
<sourceAgent QMgr="BSCMFT01">
<xsl:attribute name="agent">
<xsl:value-of select="/ProcessData/OUTPUT/SourceAgent"/>
</xsl:attribute>
</sourceAgent>
<sourceAgent QMgr="BSCMFT01" agent="{/ProcessData/OUTPUT/SourceAgent}"/>
Upvotes: 1