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

RE: br elements to root

Subject: RE: br elements to root
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Fri, 03 Jun 2005 18:19:58 +0000
prefix suffix root
Jon, you're welcome FWIW, but in XSL's defense it *is* useful for a variety of declarative transforms that would be much, much harder to do in imperative fashion. People more experienced than I may comment on this and, perhaps, provide an XSL solution where I could not, offhand.

However, I have a question: your original post had this input:

<p>
 <strong>
   strong:text(top) <br/>prefix
     <span style="a style">
       span a
       <span style="rgb();">
         span b<br/> text
       </span>
       text
      </span>
   strong:text(btm) <br/>suffix<br/>
 </strong>
 Root level text with<br/> tag.
</p>

To be transformed to this output:

<p>
 <strong>
   strong:text(top)
 </strong>
 <br/>
 <strong>
   prefix
   <span style="a style">
     span a
     <span style="rgb();">
       span b
     </span>
   </span>
 </strong>
 <br/>
 <strong>
   <span>
     <span>
      text
     </span>
     text
   </span>
   strong:text(btm)
 </strong>
 <br/>
 <strong>
   suffix
 </strong>
 <br/>
 <strong>
 </strong>
 Root level text with
 <br/>
  tag.
</p>

My question is, how did you derive the

 <strong>
 </strong>

near the end?


If going through this mentally I would expect to close </strong> after the penultimate <br/>, and then not open-close a <strong> because it's not readily apparent that it's needed. Except, of course, if you were creating the output (above) in lexical fashion -- closing opening tags and opening closing tags. (In which case you were already at the procedural solution, of course).


Regards,


--A

From: jpk <jopaki@xxxxxxxxx>
Sir,

I want to thank you for your very helpful input.  I
ended up doing just this - but in Java.  I don't think
XSL has the "easy" ability to do such a task since its
notion of an "element" is not the element itself
rather itself AND its children along with its matching
end tag.  I don't really find XSL very useful and am
dismayed by it.

Jon

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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.