[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] are the regular expressions over xml structure?
- From: Oleg Parashchenko <olpa@uucode.com>
- To: Andrew Welch <andrew.j.welch@gmail.com>
- Date: Mon, 2 Jul 2012 15:50:46 +0200
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]