Subject: [xsl] how to do set operations (intersection, unify, relative compelent) on sequences (or any other possible structure); runtime dynamical structures? From: "Mtekel" <thx@xxxxxxxxx> Date: Sun, 10 May 2009 20:15:51 +0200 |
Hello, I have a another question: I have one sequence. In runtime I generate another one. Now I need a relative complement of the first to the second (all the items that are in 1st sequence, but are not in the second). The first sequence for me is tags that I need to generate in the output. The second sequence is tags that I have found data for in input, have processed them and have generated tags to output. The relative complement is then the set of tags of which data I did not encounter while processing input, thus I need to generate them with some default values. Is there some good way to do so? Should I be using some other structure instead of sequences? (now I have a sequence of strings that represent XML tags) Or other way, is it possible to extract items from the sequence in runtime? E.g. in a for-each loop? So that in the end that sequence will contain only those tags that I did not find data for. The problem I have now is if I use remove($list,index), then it returns a new list without that item. I cannot change the original list itself, the only thing I can do now to remember this newly generated list is to recursively call the same function again and give it this new list as the parameter. However I see this as very uneffective, since then the function will start the for-each loop again from the first node and go through all the already processed data again... The only way I have found to dynamically preserve in-loop generated data is to <xsl:variable> <xsl:for each> <xsl:sequence> <--here I dynamically add data to that variable </for each> </variable> Thanks again for any advice, Michael
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] how to "print" xsl:elemen, Michael Kay | Thread | Re: [xsl] how to do set operations , David Carlisle |
Re: [xsl] XSL: multiple element com, Martin Honnen | Date | Re: [xsl] how to do set operations , David Carlisle |
Month |