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

localizing XML/XSLT with entities?

Subject: localizing XML/XSLT with entities?
From: Ray Cromwell <ray@xxxxxxxxxxxxx>
Date: Fri, 4 Feb 100 21:33:15 -0500 (EST)
xul dtd

Has anyone taken a look at Mozilla's XUL/CSS/DTD architecture?  I took a look at
it recently to see how they implemented reuse/cascade in XUL with CSS/XSL, and
what I found was interesting.

On my own site, what I had done was use separate XSLT stylesheets for different
languages and look-and-feels, but this quickly turns out to be unmaintainable.
A lot of "view" oriented code is duplicated, and if you fix a bug in one
sheet, or make an enhancement, you have to update them all. And that's after
liberal use of xsl:include and xsl:import.


Mozilla takes a clever approach, but I'm unsure how "standard" it is, and
whether or not it could break future XML processors.


Simply put, Mozilla uses XML entities to reference what C++/GUI coders
and Java codes would refer to as resources or ResourceBundles.


Thus, instead of writing something like

<html:widget name="foo" label="Enter your text here."/>

they write

<html:widget name="foo" label="&foo.label;"/>

Then, all of the locale specific content it put into ENTITY
declarations in an external DTD located via a chrome:// URI that
fetches the DTD from the appropriate directory.


What confuses me, is if the XUL document already has a !DOCTYPE
declaration referencing the XUL DTD, is it legal to reference
a second external DTD?


Is there a legal way for DTD's to include another DTD or a bunch
of entity declarations? Or, for a document to reference multiple
DTD's at once?

I know you can use external entities in the main document, but ideally,
you would like to separate all the entity declarations into an
external file making it easy to edit locale specific content in
a single location without mucking with the main document DTD.


I suppose you could use xsl:include/import and load up a whole bunch of
<xsl:variable> statements to get the same effect, but the syntax for
referencing variables isn't quite as nice as entities, and sometimes
the source XML document needs localization.



-Ray














 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.