xslt transformation to list
Hi,
i have a query that returns 4 telephone numbers, and i want to map the result to a list using xsl transform in mediator.
Source
<xs:element name="telefoneDeContato1" type="xs:string/>
<xs:element name="telefoneDeContato2" type="xs:string/>
<xs:element name="telefoneComercial" type="xs:string/>
<xs:element name="telefoneFax" type="xs:string/>
Target
<xs:element name="PhoneContact" type="TelephoneNumber" maxOccurs="unbounded"/>
<xs:complexType name="TelephoneNumber">
<xs:sequence>
<xs:element name="number" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Example:
Source
<telefoneDeContato1>1111111111<telefoneDeContato1/>
<telefoneDeContato2>2222222222<telefoneDeContato2/>
<telefoneComercial>333333333<telefoneComercial/>
<telefoneFax>44444444444<telefoneFax>
Target:
<PhoneContact>
<number>1111111111<number/>
<number>2222222222<number/>
<number>333333333<number/>
<number>44444444444<number/>
<PhoneContact/>
Here is my code, i coul not map this, any help
<xsl:for-each select="/top:VSittelCustomerBaseCollection/top:VSittelCustomerBase">
<CustomerAccount>
<CustomerAccountContact>
<PhoneContact>
<number>
<xsl:value-of select="top:telefoneDeContato1"/>
</number>
</PhoneContact>
</CustomerAccountContact>
</CustomerAccount>
</xsl:for-each>