xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Match Commented elements


Subject: RE: [xsl] Match Commented elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 3 Oct 2008 09:47:50 +0100

> 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


Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor