Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Extracting date from XML comment

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 11/2/2007 11:04:00 AM

<ajrijken@h...> wrote in message 
news:1193991180.221530.287380@1......
>I have a XML a want to transform to another XML
> with the following commentline
> <!-- File generated on 15.10.2007 10:50:43 -->
>
> I need to extract the date and time and put that in a attribute
> something like this:
>
> comment
>
> <xsl:template match="/">
>
> <xsl:if test="comment()">
>      <xsl:variable name="Datum"><xsl:copy-of select="."/></
> xsl:variable> <= here I like to do the extracting of the date
> </xsl:if>
> <Field>
>  <xsl:attribute name="Name">DATE/xsl:attribute>
>   <xsl:attribute name="Value"><xsl:value-of select="$Datum"/></
> xsl:attribute>
> </Field>
> </xsl:template>
>
> This is not working I get the message Invalid variable referenceError
> in XPath expression, Invalid variable reference
>
> Any Idea on how to extract the date from teh comment?
>
> Astrid
>
Looks like your variable is out of scope. Change it to:
<xsl:variable name="Datum">
  <xsl:if test=...
</xsl:variable>

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent