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

Re: localizing XML/XSLT with entities?

Subject: Re: localizing XML/XSLT with entities?
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Sat, 05 Feb 2000 08:55:29 -0500
xslt entity declaration
At 09:33 PM 02/04/2000 -0500, Ray Cromwell wrote:
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

they write 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 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

I don't know what the Mozilla code looks like; your mailer seems to have stripped out anything that looks like markup. But it sounds like they're using INCLUDE/EXCLUDE "conditional" sections in the DTD, together with external parameter entities for incorporating other DTDs which, yes, is a legal and (not always, but sometimes!) useful approach.


An example in the XML Rec. [3.4]:

  <!ENTITY % draft 'INCLUDE' >
  <!ENTITY % final 'IGNORE' >

  <![%draft;[
  <!ELEMENT book (comments*, title, body, supplements?)>
  ]]>
  <![%final;[
  <!ELEMENT book (title, body, supplements?)>
  ]]>

The PEs in the first two lines tell the DTD that in its current pass, the processor should include the declaration of the book element performed by the %draft; PE, and *not* include that performed by the %final; PE. If you want the processing to treat the book element as though it declares a "final version's" content model, just switch the INCLUDE/IGNORE values of the two PEs.

(Further discussion along these lines probably should move off-list, or to XML-L or XML-DEV.)
====================================================================
John E. Simpson | My girlfriend asked me, "Did you sleep
simpson@xxxxxxxxxxx | good?" I said, "No, I made a few
http://www.flixml.org | mistakes." (Stephen Wright)



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.