I want to use pattern matching methods to add some additional tags to the textual content of elements in some xml files.  The simplest example of what I have to do is to spit out paragraph numbers as separate elements preceding the paragraph:
<Paragraph>(a) This is some text.</Paragraph>
should end up as
<Label>(a)</Label><Paragraph>This is some text</Paragraph>
It seems to me that I might accomplish the task by passing text to a saxon extension function that does the pattern matching, splits the text up and returns a NodeList containing the additional markup that could then be processed by other templates.
I am a bit unclear on how to go about constucting the NodeList from the contents of the element.  I have read Michael's document on extensibility.  Is there another place to look on how to build the NodeList?
On a slightly different note, if anyone thinks there is a better way to do this, please let me know.  Maybe it would be simpler to run the xml files through a sax filter and do the pattern matching there.
- David Penton -