[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How would I create this derived field in XML from
On 29.10.2014 20:44, Catherine Wilbur cwilbur@xxxxxxxxxxx wrote:
*_Below in my xsl code am getting a syntax error on the following line_* Use single quotes to delimit the picture string when you used double quotes for the select attribute. select="format-dateTime(current-dateTime(),'[Y0001][M01][D01][H01][m01]')"
This wonbt work because a) the scope of the variable declarations will be limited to the xsl:when and xsl:otherwise branches, respectively. There wonbt be a variable $POOwnerType outside of them. b) the strings 'W' and 'L' arenbt properly delimited c) there is no function contains-case-insensitive() Use this for the variable declaration: <xsl:variable name="POOwnerType" as="xs:string"> <xsl:choose> <xsl:when test="matches($InvoicePOLineOwner, 'Law', 'i')"> <xsl:sequence select="'W'"/> </xsl:when> <xsl:otherwise> <xsl:sequence select="'L'"/> </xsl:otherwise> </xsl:choose> </xsl:variable> or shorter <xsl:variable name="POOwnerType" as="xs:string" select="if (matches($InvoicePOLineOwner, 'Law', 'i')) then 'W' else 'L'"/> If you use an editor such as oXygen it will make you aware of all these issues, thanks to the embedded Saxon processor. Because the XML input lacks essential parts, I was unable to validate the remainder of your XSLTbs functionality. If you want me to check it, you may send me a complete input off-list. Of course you might ask the next question on the list when you encounter the next hurdle. Keep on exploring XSLT 2, itbs totally worth it! Gerrit
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|