I have a scenario to validate date from incoming xml file, which has effectiveTime as a element, the format of that element can be one of them as below
1)
<effectiveTime value="YYYYMMDD"/>
or
2)
<effectiveTime>
<low value="YYYYMMDD"/>
<high value="YYYYMMDD"/>
</effectiveTime>
if the incoming file has the format specified as point 1 (as mentioned above), then i need to validate @value
is in YYYYMMDD or not, if it is in other format (2nd), i need to verify low @value
date is less than or equal to high @value
or not.
I have this element (<effectiveTime>
) in couple of the places in my incoming XML file, I would like to write one xsl:function which can validate this scenario and i would like to send node (here effectiveTime) as param to the xsl:function.
<xsl:function name="util:validateEffectiveTime" as="xs:boolean">
<!-- I would like to know xml schema data type for the param -->
<xsl:param name="effectiveTimeP" as="****"/>
</xsl:function>
Can i go ahead and create any xsl:function (util:validateEffectiveTime) with accepting node as a parameter to that xsl:function and also let me know the xml schema data type i need to assign to param (effectiveTimeP) ?
Thanks !