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

Re: XSLT Solution for hyphenation

Subject: Re: XSLT Solution for hyphenation
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 28 Dec 2006 09:49:36 -0500
hyphenation xslt
Jeff,

At 08:56 PM 12/27/2006, you wrote:
heres a sample of the look-up table:

<root>
<wordlist>
  <entry>
    <search>abaissassent</search>
    <replace>abais&#x00AD;sassent</replace>
  </entry>
  <entry>
    <search>abaisshrent</search>
    <replace>abais&#x00AD;shrent</replace>
  </entry>
  <entry>
    <search>abandonnent</search>
    <replace>aban&#x00AD;donnent</replace>
  </entry>
</wordlist>
</root>

A key to retrieve replace elements from this table might be:


<xsl:key name="replacements" match="replace" use="../search"/>

Then, given the value "abaissassent" in your
stylesheet as $search, you could ask for
key('replacements',$search) and get back the
replace element with the value "abais&#x00AD;sassent".

Another way, which is a bit of a circumlocution
but, you might think, a bit clearer:

<xsl:key name="searched-entries" match="entry" use="search"/>

which would require you traverse from the entry
element node returned by the key, as in

key('searched-entries',$search)/replace

I hope that helps --
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

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-2007 All Rights Reserved.