Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - [xsl] xml cells transformed in to a 2-d table, some table cells missing, full table required - constant variables. [Thread Next] RE: [xsl] xml cells transformed in to a 2-d table, some table cells missing, full table required - constant variables.To: Date: 1/3/2009 10:54:00 PM > When using XSLT 1.0 I got various error messages with the > above syntax. > XPath error : Invalid expression > if (exists($ig)) then $ig/length else 0 > ^ Yes, sorry, I'm very out of practice with writing 1.0 code. You have to expand the XPath if()then ...else to an XSLT xsl:choose. The exists() function can often be replaced with boolean() or just omitted <xsl:choose> <xsl:when test="$ig"> <xsl:value-of select="$ig/length"/> </xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> or there's often a less verbose way, as you say here using string-length. Michael Kay http://www.saxonica.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
