p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XSLT (http://p2p.wrox.com/forumdisplay.php?f=86)
-   -   Invalid Token (http://p2p.wrox.com/showthread.php?t=64787)

sani723 December 24th, 2007 05:19 AM

Invalid Token
I have a xml file having following data

<?xml version="1.0" encoding="utf-8" ?>
    <emp sDate="01-11-2007" eDate="30-11-2007">
    <emp sDate="01-12-2007" eDate="31-12-2007">


and then i use this XPath to get the value

$CheckInDate = 20071225;

company/emp[concat(substring-after(substring-after(@sDate,'-'),'-'),substring(substring-after(@sDate,'-'),1,2),substring-before(@sDate,'-')) &lt; $CheckInDate and concat(substring-after(substring-after(@eDate,'-'),'-'),substring(substring-after(@eDate,'-'),1,2),substring-before(@eDate,'-')) &gt;= $CheckInDate]/Child

but it gives error that expression [u]has an invalid token.</u>

any sort of help will be appreciated.

I Love XML and family

joefawcett December 24th, 2007 05:40 AM

Well you could simplify matters by breaking down the date extraction into separate parts and also by using substring(@eDate, 7, 4) to get the year.


Joe (Microsoft MVP - XML)

sani723 December 25th, 2007 01:42 AM

Thanks joefawcett, problem solved after applying your suggestion.

I Love XML and family

All times are GMT -4. The time now is 10:30 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.