XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] are the regular expressions over xml structure?

Hello Andrew,

On Mon, 2 Jul 2012 14:07:26 +0100
Andrew Welch <andrew.j.welch@gmail.com> wrote:

...
> > "element(image), element(caption), element(table[some condition])"
...
> You could do it with match patterns:
> 
>     <xsl:template match="image">
>         image element not followed by caption and table[condition]
>     </xsl:template>
> 
>     <xsl:template
> match="image[following-sibling::*[1][self::caption]]
> [following-sibling::*[2][self::table[@type = '1']]]">
>         the group
>     </xsl:template>

Unfortunately, this code is not enough. Imagine a mostly identity
transform with such grouping. What to do with the elements "caption"
and "table"?

* In "the group" mode, copy them
* Otherwise, ignore them

The latter -- detect if an element should be ignored -- requires
a complicated matching code.

> 
> 
> -- 
> Andrew Welch
> http://andrewjwelch.com
> 


-- 
Oleg Parashchenko  olpa@ http://uucode.com/
http://uucode.com/blog/  XML, TeX, Python, Mac, Chess


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS