[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Tokenizing mixed content

Subject: Tokenizing mixed content
From: "Edward Porter edward.porter@xxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 May 2019 13:22:03 -0000
 Tokenizing mixed content
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:

INPUT:
<argument> "AUTO | NONE | METADATA"</argument>
OUTPUT:
<argument><choice>AUTO</choice><choice>NONE</choice><choice>METADATA</choice>
"</argument>

INPUT:
<argument><userSuppliedValue>dimension</userSuppliedValue> |
<userSuppliedValue>dimension</userSuppliedValue>%</argument>
OUTPUT:
<argument><choice><userSuppliedValue>dimension</userSuppliedValue></choice><c
hoice><userSuppliedValue>dimension></userSuppliedValue>%</choice></argument>


INPUT:
<argument>#BYVAL<userSuppliedValue>n</userSuppliedValue> |
#BYVAL(<userSuppliedValue>BY-variable-name</userSuppliedValue>)</argument>
OUTPUT:
<argument><choice>#BYVAL<userSuppliedValue>n</userSuppliedValue></choice><cho
ice>#BYVAL(<userSuppliedValue>BY-variable-name</userSuppliedValue>)</choice><
/argument>

I've got access to XSL 2, and possibly XSL3 if necessary.

Thanks in advance for any ideas!

-Edward

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.