Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > 'state' in xsl program

Reply
Thread Tools

'state' in xsl program

 
 
Mike@miscanthus.net
Guest
Posts: n/a
 
      09-14-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
tomcal/xsl - problems with xsl:include Klaus Friese Java 0 11-22-2004 10:17 AM
XSL-1000: (Fatal Error) Error while parsing XSL file (org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy) Kevin Flood Java 1 09-13-2004 02:28 PM
XSL-1000: (Fatal Error) Error while parsing XSL file (org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy) Kevin Flood Java 0 09-08-2004 02:11 PM
use xsl:element to output an "<xsl:template match=...> ? Ray Tayek XML 3 11-30-2003 10:14 AM



Advertisments