Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Is this possible using XSLT?

From: Raffaele Sena <raff@------------>
To:
Date: 7/3/2006 4:59:00 PM
Maybe you can match on @lefparen != "" and use a recursive function to 
open a <paren> tag for each "(".



In the function you also process your bar tags and return when 
@rightparent = ")"



Too lazy to try to write real code, but I think it may work.



-- Raffaele




Rob Allen wrote:
Hello,



Is it possible to get XSLT to transform XML that looks
like this:
<foo>
    <bar leftparen="((" rightparen="" num="3" oper="*"
/>
    <bar leftparen="" rightparen=")" num="2" oper="-"
/>
    <bar leftparen="" rightparen=")" num="2" />
</foo>

into something that looks like this:
<foo>
   <paren>
     <paren>
       <bar num="3" oper="*"/>
       <bar num="2" oper="-"/>
     </paren>
     <bar num="2"/>
   </paren>
</foo>

"paren" elements are opened and closed based on the
number of '(' in each element's leftparen and
rightparen attributes.
Can anyone help?
Thanks,

Rob







__________________________________________________

Do You Yahoo!?

Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 







!DSPAM:44a9139144561971730823!


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent