R
Rupa
Hi,
I'm trying to write an xslt to convert an email in xml format to a new
xml format.
<descr>
<xsl:choose> <xsl:value-of select="body"> </xsl:value-of select>
<xsl:when test=" <xsl:value-of select="body/size_in_chars"> >
1042"></xsl:when>
<xsltherwise> SOMETHING HERE THAT I HAVEN'T SORTED OUT YET
</xsltherwise>
</xsl:choose>
</descr>
My first problem is the test condition. I need to check whether the
size of the body of the email is less than 1024. In the original xml
document, it looks like this:
<body size_in_chars="someNumber"> body of email is here </body>
Is there a way for me to access the size_in_chars element and use it
in my test?
My second problem is that if the body is greater than 1024, I need to
truncate the body after that and select only the first 1024 characters
for <descr>. Something like this:
<descr> <xsl:value-of select=truncate("body", 1024)> </xsl:value-of>
</descr>
(I'm just using truncate() as a way to show what I need to do - don't
know if there actually is a function to do that and what it would be
called if it exists.)
Thanks!
Rupa
I'm trying to write an xslt to convert an email in xml format to a new
xml format.
<descr>
<xsl:choose> <xsl:value-of select="body"> </xsl:value-of select>
<xsl:when test=" <xsl:value-of select="body/size_in_chars"> >
1042"></xsl:when>
<xsltherwise> SOMETHING HERE THAT I HAVEN'T SORTED OUT YET
</xsltherwise>
</xsl:choose>
</descr>
My first problem is the test condition. I need to check whether the
size of the body of the email is less than 1024. In the original xml
document, it looks like this:
<body size_in_chars="someNumber"> body of email is here </body>
Is there a way for me to access the size_in_chars element and use it
in my test?
My second problem is that if the body is greater than 1024, I need to
truncate the body after that and select only the first 1024 characters
for <descr>. Something like this:
<descr> <xsl:value-of select=truncate("body", 1024)> </xsl:value-of>
</descr>
(I'm just using truncate() as a way to show what I need to do - don't
know if there actually is a function to do that and what it would be
called if it exists.)
Thanks!
Rupa