'state' in xsl program

M

Mike

I am using xsl to transform xml templates to xml. The templates can
contain scalar and list 'macros'. If a list is encountered I need to
duplicate the subtree and apply one of the list's values (once for each
value).

Scalars and lists are represented in xml in-line in the xsl.

It seems like the best approach is to apply-templates to the twig that
needs replicating. The problem is that for this to work I need to
change the twig's state such that what was a list is now a scalar.

With a bit of code I can create a local copy of the state and tweak the
value of the list item to its current scalar value.

Two questions:
1) is there a better approach? (This can't be an original idea, are
there any links to other impls?)
2) is there a simpler way to maintain state during node recursion?
Thanks for the help.

--Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top