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

Re: changing source-tree

Subject: Re: changing source-tree
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 10 Nov 2005 15:05:47 GMT
Re:  changing source-tree
>   Hi,
>
>   the solution to my problem would be easy 
>

Did you say what your problem was?

>   if I could change the
>   source-tree (mainly adding attributes to child-items) but I already
>   read that this is more or less impossible due to the fact that it
>   might cause infinite-loops. Or am I wrong here?

It's not a question of getting infinite loops. XSLT offers no facilities
for changing the source tree (and adding such facilities are not easy,
as execution order in XSLT is undefined). So there is no possibility of
causing loops infinite or otherwise.

>   I have the following problem:
>   <foo>
>	<example_bar>
>	...
>	</example_bar>
>   </foo>
>
>   foo triggers a template which splits a string into one or more pieces.
>   example_bar is the element which describes on how to output one of
>   them. Though I only know at runtime how many pieces there are.
>
>   My first thought was to make the foo template add as many example_bar
>   elements as the foo template produced pieces. Then I'd add an
>   attribute to each one of them and supply it with the piece of text. As
>   each one of the example_bar elements is processed it could take the
>   text from the attribute and put it into the result tree in which ever
>   way needed.
>
>   How could this be accomplished?
>   Thanks in advance
>   Manuel Baehnisch

I think you need to give at least a hint of what your input looks like,
where the string that needs splitting comes from, how it needs to be
split, and what you want the output to look like.

There are plenty of templates in the archives of this list to tokenize a
string, or some systems (eg saxon, or systems implementing exslt) have
tokenize extension functions which make that a bit easier, or you could
use xslt2 draft which has a regular expression support built in.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.