The requested result in xml after a transformation through xsl is:
...
<PROPERTY NAME="REQUESTOR" TYPE="string">
<VALUE>Testperson</VALUE>
</PROPERTY>
<PROPERTY NAME="EARLYSTART" TYPE="string">
<VALUE>2005-05-05 15:00</VALUE>
</PROPERTY>
<PROPERTY NAME="DEADLINE" TYPE="string">
<VALUE>2005-09-21 12:00</VALUE>
</PROPERTY>
<PROPERTY NAME="CI" TYPE="string">
<VALUE>SomeApp</VALUE>
</PROPERTY>
<PROPERTY NAME="OTHER" TYPE="string">
<VALUE>Title TestTitle Email testperson@somewhere.com Telephone 0123-2345678 Costlocation 401000 New application NewApp Description A description of some sort OtherApplication OtherApp </VALUE>
</PROPERTY>
...
The required fields are requestor, earlystart (earlystartdate), deadline (deliverydate), and ci (application). The mapping of theese fields are Ok.
The rest of the field elements in the source xml have to be concatenated into one element (OTHER) in the target xml.
The number of field elements will vary between runs but at least the required field elements will always be in the source xml.
For now I have the following solution
...
<xsl:for-each select="Form/field">
...
<PROPERTY NAME="OTHER" TYPE="string">
<VALUE>
<xsl:value-of select="name"/>
<xsl:value-of disable-output-escaping="yes" select="$cr" />
<xsl:value-of select="value"/>
<xsl:value-of disable-output-escaping="yes" select="$cr" />
<xsl:value-of disable-output-escaping="yes" select="$cr" />
</VALUE>
</PROPERTY>
</xsl:for-each>
...
and it gives me the following result:
...
<PROPERTY NAME="OTHER" TYPE="string">
<VALUE>New Application NewApp </VALUE>
</PROPERTY>
<PROPERTY NAME="OTHER" TYPE="string">
<VALUE>Description A description of some sort </VALUE>
</PROPERTY>
<PROPERTY NAME="OTHER" TYPE="string">
<VALUE>Other application OtherApp </VALUE>
</PROPERTY>
...
If anybody can help me I'd be really happy, I'm out of ideas :o(
Subject:concatenate many fields to one field via xsl Author:Ivan Pedruzzi Date:21 Sep 2005 04:47 PM
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<ROOT>
<xsl:for-each select="Form/field[ name = 'Requestor' or name = 'EarlyStartDate' or name = 'Deliverydate' or name = 'Application']">
<PROPERTY NAME="{name}" TYPE="string">
<xsl:value-of select="value"/>
</PROPERTY>
</xsl:for-each>
<PROPERTY NAME="OTHER" TYPE="string">
<xsl:for-each select="Form/field[name != 'Requestor' and name != 'EarlyStartDate' and name != 'Deliverydate' and name != 'Application']">
<xsl:value-of select="name"/><xsl:text>
</xsl:text><xsl:value-of select="value"/><xsl:text>
</xsl:text>
</xsl:for-each>
</PROPERTY>
</ROOT>
</xsl:template>