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

creating multi-level TOC from existing list

Subject: creating multi-level TOC from existing list
From: "Charlie0 charlieo0@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Jun 2020 23:18:07 -0000
 creating multi-level TOC from existing list
I need help with XSLT 2.0. I am completely stumped on how to proceed. I have tried doing string comparisons and that is not working. I am sure there is way to use grouping to accomplish what I need, but I just don't know how to create two separate groups and build the TOC I need. I have no code to show. Any help to put me in the right direction is appreciated.

Below is the input, followed by the desired output. Text has been distorted due company policies.

Input snippet:

<toc>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0100 VNGKNV XSSVMBLY">
B B B B B B B B B B B <tocEntry filename="M2390992350401.xml" title="RVZXKR LUBV CKL FKLTVR XSSVMBLY"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0100 VNGKNV XSSVMBLY">
B B B B B B B B B B B <tocEntry filename="M2812292350401.xml" title="RVZLXCV HYDRXULKC RVSVRVCKR BRXCKVT"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0100 VNGKNV XSSVMBLY">
B B B B B B B B B B B <tocEntry filename="M3007592350401.xml"
B B B B B B B B B B B B B B B title="RVZLXCV VNGKNV FRCM SHKZZKNG/STCRXGV CCNTXKNVR"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0102 CRXNKSHXFT">
B B B B B B B B B B B <tocEntry filename="M2356292350401.xml"
B B B B B B B B B B B B B B B title="RVZLXCV VKBRXTKCN DXMZVR XND CRXNKSHXFT ZULLVY"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0102 CRXNKSHXFT">
B B B B B B B B B B B <tocEntry filename="M2357392350401.xml" title="RVZLXCV RVXR CRXNKSHXFT SVXL"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0103 FLYWHVVL XSSVMBLY">
B B B B B B B B B B B <tocEntry filename="M2357292350401.xml" title="RVZLXCV FLYWHVVL"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0103 FLYWHVVL XSSVMBLY">
B B B B B B B B B B B <tocEntry filename="M2390892350401.xml" title="RVZLXCV RVXR CRXNKSHXFT XDXZTVR"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="03 FUVL SYSTVM">
B B B B B B B <tocEntry title="0304 XKR CLVXNVR">
B B B B B B B B B B B <tocEntry filename="M2142592350401.xml" title="RVZLXCV XKR CLVXNVR BCCT"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="03 FUVL SYSTVM">
B B B B B B B <tocEntry title="0304 XKR CLVXNVR">
B B B B B B B B B B B <tocEntry filename="M2376292350401.xml"
B B B B B B B B B B B B B B B title="RVZLXCV TURBCCHXRGVR CCMZRVSSCR KNTXKV ZRVSSURV/TVMZVRXTURV SVNSCR"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="03 FUVL SYSTVM">
B B B B B B B <tocEntry title="0305 SUZVRCHXRGVR, BLCWVR, TURBCCHXRGVR CR XLTKTUDV CCMZVNSXTCR">
B B B B B B B B B B B <tocEntry filename="M2249792350401.xml" title="RVZLXCV TURBCCHXRGVR "/>
B B B B B B B </tocEntry>
B B B </tocEntry>
</toc>


Desired output:


<toc>
B B B <tocEntry title="01 VNGKNV">
B B B B B B B <tocEntry title="0100 VNGKNV XSSVMBLY">
B B B B B B B B B B B <tocEntry filename="M2390992350401.xml" title="RVZXKR LUBV CKL FKLTVR XSSVMBLY"/>
B B B B B B B <tocEntry filename="M2812292350401.xml" title="RVZLXCV HYDRXULKC RVSVRVCKR BRXCKVT"/>
B B B B B B B B B B B <tocEntry filename="M3007592350401.xml"
B B B B B B B B B B B B B B B title="RVZLXCV VNGKNV FRCM SHKZZKNG/STCRXGV CCNTXKNVR"/></tocEntry>
B B B B B B B <tocEntry title="0102 CRXNKSHXFT">
B B B B B B B B B B B <tocEntry filename="M2356292350401.xml" title="RVZLXCV VKBRXTKCN DXMZVR XND CRXNKSHXFT ZULLVY"/>
B B B B B B B B B B B <tocEntry filename="M2357392350401.xml" title="RVZLXCV RVXR CRXNKSHXFT SVXL"/>
B B B B B B B </tocEntry>
B B B B B B B <tocEntry title="0103 FLYWHVVL XSSVMBLY">
B B B B B B B B B B B <tocEntry filename="M2357292350401.xml" title="RVZLXCV FLYWHVVL"/>
B B B B B B B B B B B <tocEntry filename="M2390892350401.xml" title="RVZLXCV CRXNKSHXFT XDXZTVR"/>
B B B B B B B </tocEntry>
B B B </tocEntry>
B B B <tocEntry title="03 FUVL SYSTVM">
B B B B B B B <tocEntry title="0304 XKR CLVXNVR">
B B B B B B B B B B B <tocEntry filename="M2142592350401.xml" title="RVZLXCV XKR CLVXNVR BCCT"/>
B B B B B B B B B B B <tocEntry filename="M2376292350401.xml"
B B B B B B B B B B B B B B B title="RVZLXCV TURBCCHXRGVR CCMZRVSSCR KNTXKV ZRVSSURV/TVMZVRXTURV SVNSCR"/>
B B B B B B B </tocEntry>
B B B B B B B <tocEntry title="0305 SUZVRCHXRGVR, BLCWVR, TURBCCHXRGVR CR XLTKTUDV CCMZVNSXTCR">
B B B B B B B B B B B <tocEntry filename="M2249792350401.xml" title="RVZLXCV TURBCCHXRGVR "/>
B B B B B B B </tocEntry>
B B B </tocEntry>
</toc>


Regards

Charlie

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.