This question is in regard to replace filters, but is generalizable for other types of XML-based operations.
Is it possible to process XML data in such a way that all data within the boundaries of tag expressions and processing instructions, e.g., <tag attribute="foo"> is skipped, and only the PCDATA wrapped within tags is matched? The restrict filter seems to be not quite intelligent enough to perform this sort of operation (it may be possible to do this with a regex expression, but I cannot figure out how to write the expression properly).
Example:
Let's say I wanted to find the quote character and replace it with a tilde (but only in PCDATA):
Because (a) it doesn't seem to like attributes within elements, and (b) doesn't seem capable of properly treating in-line elements. Try it on the samples I posted and let me know how the restrict to XML element filter works out for you.
Restrict to between tags <tag1>...</tag1>
| [ ] Include text
| [ ] Match case
|
+--Restrict to between tags <phrase>...</phrase>
| [ ] Include text
| [ ] Match case
|
|--Perl pattern ["] with [###MARKER###]
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [X] '.' matches newline
| [ ] UTF-8 Support
|
|--Perl pattern [<\?proc[^>]*>] with [$0]
| | [ ] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [ ] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [ ] Maximum match (greedy)
| | [ ] Allow comments
| | [X] '.' matches newline
| | [ ] UTF-8 Support
| |
| +--Perl pattern [###MARKER###] with ["]
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [X] '.' matches newline
| [ ] UTF-8 Support
|
+--Perl pattern [###MARKER###] with [~]
[ ] Match case
[ ] Whole words only
[ ] Case sensitive replace
[ ] Prompt on replace
[ ] Skip prompt if identical
[ ] First only
[ ] Extract matches
Maximum text buffer size 4096
[ ] Maximum match (greedy)
[ ] Allow comments
[X] '.' matches newline
[ ] UTF-8 Support