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?


I did consider doing this in my 2006 paper on positional grouping which 
was a precursor to the windowing facility in XQuery 3.0

http://www.saxonica.com/papers/positionalgrouping.pdf

but rejected it as too complex.

Michael Kay
Saxonica


On 29/06/2012 09:52, Oleg Parashchenko wrote:
> Hello,
>
> are there libraries to work with XML structure using regular expressions?
>
> Something like this, in pseudocode:
>
> rx = xml_re.compile('''(h1, (not h1)*)''')
> rx.sub('''<section>\0</section>''', xml_doc)
>
> If the content of xml_doc was
>
> <x>
> <h1>Heading 1</h1>
> <p>text 1</p>
> <p>text 2</p>
> <h1>Heading 2</h1>
> <p>text 3</p>
> </x>
>
> then the substitution should result in:
>
> <x>
> <section>
>    <h1>Heading 1</h1>
>    <p>text 1</p>
>    <p>text 2</p>
> </section>
> <section>
>    <h1>Heading 2</h1>
>    <p>text 3</p>
> </section>
> </x>
>
> Any hints are welcome!
Try this, whic:

<xsl:stylesheet...>

<xsl:import-schema>
<xs:schema>
<xs:complexType name="T">
>
>
>


[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