2

I need to further process an xsl value that I generated like this:

<xsl:value-of select="adjust-dateTime-to-timezone(xs:dateTime('2006-02-15T17:00:00-03:00'), xs:dayTimeDuration('-PT7H'))" />

I want to take the result of that and keep only a few substrings (3 substrings operations).

How can I achieve that? For now the code above dumps the result in the resulting transformation as '2006-02-15T13:00:00-07:00'.

1 Answer 1

5

You can set a variable to the value your function returns and then use that variable for any other transformations.

<xsl:variable name="result" select="adjust-dateTime-to-timezone(xs:dateTime('2006-02-15T17:00:00-03:00'), xs:dayTimeDuration('-PT7H'))" />

or

<xsl:variable name="result">
    <xsl:value-of select="adjust-dateTime-to-timezone(xs:dateTime('2006-02-15T17:00:00-03:00'), xs:dayTimeDuration('-PT7H'))" />
</xsl:variable>

and then

<xsl:value-of select="$result"/>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.