Reputation: 63
I have created a number of functoids on the map to validate the source node 'AdoptedDate' for default values (Equals defaultvalues into an Logical OR through to a Value functoid with a new default value. Then an Logical Not for if neither of the Equals are not true to map the source node 'AdoptedDate' across to the destination schema (xslt enclosed).
What I would like to do is implement this for all date fields in the source schema, can this be done.
<xsl:for-each select="Form/SDetails">
<xsl:variable name="var:v17" select="userCSharp:LogicalEq(string(NameDetails/AdoptedDate/text()) , "1900-09-09")" />
<xsl:variable name="var:v18" select="string(NameDetails/AdoptedDate/text())" />
<xsl:variable name="var:v19" select="userCSharp:LogicalEq($var:v18 , "1800-09-09")" />
<xsl:variable name="var:v20" select="userCSharp:LogicalOr(string($var:v17) , string($var:v19))" />
<xsl:variable name="var:v22" select="userCSharp:LogicalNot(string($var:v20))" />
<xsl:if test="string($var:v20)='true'">
<xsl:variable name="var:v21" select=""1901-01-01"" />
<p:AdoptedDate>
<xsl:value-of select="$var:v21" />
</p:AdoptedDate>
</xsl:if>
<xsl:if test="string($var:v22)='true'">
<xsl:variable name="var:v23" select="NameDetails/AdoptedDate/text()" />
<p:AdoptedDate>
<xsl:value-of select="$var:v23" />
</p:AdoptedDate>
</xsl:if>
Upvotes: 0
Views: 564
Reputation: 11527
Your options are
In all situations you will have to have to have a functoid linked to the source and destination fields.
Upvotes: 1