Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Search/Replace text in XML file
January 9, 2008, 7:21 pm
rate this thread
Re: Search/Replace text in XML file
I'm working on a modification of a module I wrote to do this type of thing
(started last week).
But what you have stated on top is that you want to first "find" a version
element that is "not"
inside of another element. This is hard to do bro.
You don't want to setup a search of tags with conditionals (in the general
sense.) Its not like
regexpresions for xml. In the limited sense, as a basis, a search is setup as a
singular for that "tag".
Should it encounter another identical "tag", does the search start over even if
you have found "sub-tags"
in a tree, thereby invalidating this search, resetting it. Anchored/Unanchored
(outer/inner if you will).
In parsing XML its easy to push/pop tags to determine validity. So its easy to
say, find tag1->tag2->...
Inner/outer may be selectable. What about attribute names as conditionals?
What about other items? What about content? Should content be a condition?
What should happen when all the conditions are met? What should be replaced, the
tag, the attribute name/value,
the content? What if the content is spread over other items before closure?
To integrate a search & replace engine into a stream parser is a dificult task
indeed. I am going to start slow,
tags and attributes first and move up from there.