Jump to content

xquery help


dmllc

Recommended Posts

I don't think XSLT provides dynamical functions to check if a string matches the current date. I think there was some XPath 2.0 function that formats the date so you could then check it, but that's still not supported anywhere.I see that you're using some exslt.org extensions though, so I guess that's just another one you'll need.As for how to select the date without the hour, you could use the substring() function. It would requre a lot of substring() functions if you want to reformat the date though.

Link to comment
Share on other sites

i think i found a way to accomplish what i want, but the xpath function is not working like i thought it would.<xsl:value-of select="substring('pubDate',1,15)" /> is returning the string pubDate instead of the first 15 characters of a xml pubDate value: Thu, 01 Jun 2006 15:45:00 EDTwhat is the correct xpath function to display Thu, 01 Jun 2006 15:45:00 EDT as Thu, 01 Jun 2006?

Link to comment
Share on other sites

get rid of the speechmarks around pubdate:

<xsl:value-of select="substring(pubDate,1,15)" />

If you use speechmarks inside an xpath expression/function then xpath thinks that you have put a value between the speechmarks, not the name of the element you need to look at.To see what I mean try:

<xsl:value-of select="pubDate" />

and then try:

<xsl:value-of select="'pubDate'" />

:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...