xsl-list
[Top] [All Lists]

[xsl] XSLT 2: Best Way to Synthesize Elements Given List of Tagnames

2016-11-05 11:19:01
Say I have this string: "foo/bar" (or any arbitrarily-long sequence of
/-delimited tag names) and want to construct from it:

<foo>
  <bar>
    <!-- Stuff added here that I get from somewhere else -->
  </bar>
</foo>

Is there an easier or more obvious way to generate this than an recursive
function?

With a recursive function I can easily create child elements until the
sequence is exhausted but it feels like there should be an easier way
using XSLT 2 but if there is I'm not thinking of it.

Cheers,

Eliot

--
Eliot Kimber
http://contrext.com
 



--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>