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

Re: Building cross-referenced texts with XSLT

Subject: Re: Building cross-referenced texts with XSLT
From: Aaron Optimizer Digulla <digulla@xxxxxxxx>
Date: Mon, 26 Aug 2002 19:34:56 +0200
xslt leave nodes alone
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


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.