in reply to Re: Ugly XML processing looking for a pure XML solution
in thread Ugly XML processing looking for a pure XML solution

I agree theoretically, my only problem is that practically I did not find a way to do it.

The problem is applying a regexp (or regexp-like) expression to a series of tag to wrap them. It looks like I have to face one of 2 nasty problems: either I rewrite the XML parsing process or I rewrite the regexp engine! Not being Ilya the choice was easy ;--)

I don't think that either XPath or XSLT would let me define a _range_ of elements to be wrapped with the same flexibility the regexp engine gives me. I think XPointer is supposed to include ranges, but I don't know how flexible it will be, and I don't know of any Perl module that supports it.

The problem seems to be just outside of the specs of most existing tools or standards.

  • Comment on Re: Re: Ugly XML processing looking for a pure XML solution