'state' in xsl program

Mike (archive)

Usenet Archive
Joined
Dec 14, 1999
Messages
1,131
Reaction score
0
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

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top