Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - RE: [xml-dev] xpath expression with fallback if no match is found [Thread Next] RE: [xml-dev] xpath expression with fallback if no match is foundTo: "'Sebastian Prehn'" <sebastian.prehn@----------------.--> Date: 5/8/2009 8:15:00 AM > thank you for the quick help! I came up with: > <xsl:variable name="date" select="abc:def/date" /> > <xsl:value-of select="if (boolean($date)) then $date else > '0000-00-00'" /> the boolean() is not neccessary. > > Im not sure which xpath version my saxon test program > supports, since the transformation of your first suggestion > failed with "expected ")". > Correction to previous response. If "if() then else" works, then I would expect (a,b)[1] to work. Use -t on the command line to see which version you are using. > > > > <xsl:value-of select="(abc:def/date, '0000-00-00')[1]"/> > > Michael Kay http://www.saxonica.com/ _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: xml-dev-unsubscribe@l... subscribe: xml-dev-subscribe@l... List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
