[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 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] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|