on 09-06-2007 10:28 PM
Hi All,
Source structure of my message is :
<recordset>
<Query></Query>----
0 to unbounded
</recordset>
Target Structure :
<SQL>
<key></key>----
0 to unbounded
</SQL>
Now my requirement is such that....if the source message has 3 Query elements then XI should generate key node in target message 3 times but with names key1,key2,key3.
I am not able to set the names of these target nodes at runtime based on the number of query elements in source message.
Can anybody please help me?
HI,,
YOu can not change the names of your "Fields".
Hi,
If you want to change Value you can do that by writing UDF.
Enter this code in UDF.
for(int i=0;i<a.length();i++)
{
result.addValue("");
}
Regards,
Akshay Jamgoankar.
Reward points if find useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
can you make use of xslt mapping or java mapping
try this xslt code
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<sql>
<xsl:apply-templates select="//Query[1]"></xsl:apply-templates>
</sql>
</xsl:template>
<xsl:template match="Query" name="call">
<xsl:param name="count" select="1"></xsl:param>
<xsl:element name="Key{$count}">
<xsl:value-of select="."></xsl:value-of>
</xsl:element>
<xsl:apply-templates select="following::Query[1]">
<xsl:with-param name="count" select="$count + 1"></xsl:with-param>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.