[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Tokenizing mixed content
On 17.05.2019 15:22, Edward Porter edward.porter@xxxxxxx wrote:
I am working on a conversion script transforming from a prior DTD to a new DTD, and as part of this transformation, we are hoping to parse some mixed content into separate nested elements. The content is | delimited, but I am having a tough time coming up with a way to group the text and sibling elements. What follows are some permutations of input and expected output: <argument><choice>AUTO</choice><choice>NONE</choice><choice>METADATA</choice> "</argument>
<argument><choice><userSuppliedValue>dimension</userSuppliedValue></choice><c hoice><userSuppliedValue>dimension></userSuppliedValue>%</choice></argument>
<argument><choice>#BYVAL<userSuppliedValue>n</userSuppliedValue></choice><cho ice>#BYVAL(<userSuppliedValue>BY-variable-name</userSuppliedValue>)</choice>< /argument>
A two pass transformation that first processes text nodes to "convert" the pipe character into an element (e.g. <pipe/>) and then in second step uses for-each-group group-ending-with="pipe" should help.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|