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

Replacing specific acronyms in output

Subject: Replacing specific acronyms in output
From: "thei" <thei@xxxxxxxxx>
Date: Fri, 13 Feb 2004 18:10:42 +1000
xhtml acronym tag parsing
Hello,

I've a journal, which stores its data in an XML file. I use XSLT to
dynamically transform this into various output formats - XHTML in this
case, based on various criteria such as the date to display and so on.
The XSLT used to do this transformation is available here
http://nedmartin.org/journal/xsl/ , although it is probably not very
relevant to my question. 'day.xsl' shows single days; 'full.xsl' shows
full years and so forth. 'journal-imports.xsl' does the actual
transformation.

I also have an XML list of acronyms used throughout my journal,
formatted thus:
<acronyms>
  <acronym acronym="CSS">Cascading Style Sheet</acronym> 
  <acronym acronym="CGI">Common Gateway Interface (web scripting
facility) or Computer-Generated Imagery (movie industry)</acronym>
  ...
</acronyms>

I wish to be able to automatically replace any occurrence of an acronym
in the XHTML output with the appropriate XHTML <acronym title="Cascading
Style Sheet">CSS</acronym> tag.

I have thought about it and I can't think of any way to do this that
wouldn't involve parsing my journal and on every single word of my
journal, parsing every single acronym in my acronyms list - thus for
every word in my journal my entire acronym list would be parsed -
something I assume would be highly inefficient.

In case it matters, my journal is in the format:
<journal>
  <year date="2004">
    <month date="01">
      <day date="01>
        <content time="...">blah blah</content>
        ...
      ...
    <month date="02">
    ...
  </year>
</journal>
or view the schema: http://nedmartin.org/journal/xsl/journal.xsd


There has to be a good way to do this?

Help much appreciated,
Ned

Printed on 100% recycled electrons.
http://nedmartin.org




 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.