Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Match Commented elements

From: "Michael Kay" <mike@------------>
To:
Date: 10/3/2008 8:48:00 AM
> Hi
> This seems odd but you people must have any solution. Can we 
> match below "comment" element which is commented. 

It's not an element. It's a string whose value looks like the lexical
representation of an element.

I have seen 
> the role of <xsl:template match="comment()"> but not able to apply.

<xsl:template match="comment()[matches(.,
'&lt;comment&gt;.*&lt;/comment&gt;')]"

If your input documents contain lots of structured data within comments (why
do people do this kind of thing?) then you might find saxon:parse() useful,
allowing you to parse the contents of the comment and treat it as XML.

Michael Kay
http://www.saxonica.com/

> 
> Input
> <meta>
> <!--
> <comment>...</comment>
> -->
> </meta>
> 
> Output
> <meta scheme="comment" content="..."/>
> 
> Thanks
> ...JSR


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