[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Building cross-referenced texts with XSLT
On Sun, Aug 25, 2002 at 04:44:49PM -0400, G. Ken Holman wrote: > At 2002-08-25 20:56 +0200, Aaron Optimizer Digulla wrote: > >How can I write a script that converts "Lady Asano" into &LadyAsano; > >and "Nagao" into &Nagao; but which leaves &Nagao; (or the expanded > >entity) alone? > > By not using XSLT. > > An XSLT stylesheet does not manipulate markup, it manipulates node > trees. The XSLT processor reads the input markup and delivers node trees > to the stylesheet and then takes the resulting node tree built by the > stylesheet to create the output markup if so requested. > > This means that entities and the manipulation of markup syntax is outside > of the control of the stylesheet. > > I hope this helps the understanding, though I realize it means you won't > have an answer to your question. > > ................... Ken Actually, I found a solution but it's three-step: 1. I create a 1:1 copy XSL which adds <REPLACE> elements around the parts where replacement should take place. 2. I run that though a simple Python programm which ignores anything outside of <REPLACE> elements and adds the new stuff. 3. Then I run the output again through a script which compresses the expanded entities again. This way, I can use the knowledge about structured content from the XSL tool plus the power of regexps without having either applied at the wrong place. There is no way to tell xsltproc to leave the entities alone, I guess? That would allow me to skip step#3 - just a nice to have. Sometimes, all it needs is to explain the problem to someone. Thanks! -- ============================================== Sowatec AG, CH-8330 Pfäffikon (ZH) Witzbergstr. 7, http://www.sowatec.com Tel: +41-(0)1-952 55 55 Fax: +41-(0)1-952 55 66 ---------------------------------------------- Aaron "Optimizer" Digulla, digulla@xxxxxxxxxxx ============================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|