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

Re: XSL and entities

Subject: Re: XSL and entities
From: James Clark <jjc@xxxxxxxxxx>
Date: Sun, 20 Sep 1998 10:50:16 +0700
xml xsl latex example
G. Ken Holman wrote:

> If you are willing to express the "concepts" (dare I say semantics?) of foo
> in XML, say FooML, and then write a translator from FooML to foo, you would
> be able to then use XSL to do your arbitrary conversions from XML->foo as
> follows:
> 
>   XML ---XSL--> FooML ---FooXlate--> foo
> 
> This does, however, require the FooXlate program to be written, say on top
> of SAX, but written *only once* for all the semantics of whatever makes
> sense for Foo and *without regard* for the transformations necessary from
> other markup languages.

This is the right approach.  To make this work smoothly

- give FooML a namespace URI

- specify that with the result-ns attribute

- use result elements from that namespace (typically by specifying an
xmlns attribute)

- configure your XSL processor with an association between the namespace
URI with the FooXlate program

Then you can translate using XSL to foo and the XSL processor can
automatically give you foo instead of FooML.

Note that FooML doesn't have to be an elaborate expression of the
semantics of Foo in XML (although there advantages if you can do that). 
It can be braindead simple.  For example, for LaTeX a DTD like this
would be probably enough:

<!DOCTYPE LaTeX [
<!ELEMENT LaTeX (#PCDATA|markup)*>
<!ELEMENT markup (#PCDATA)>
]>

The LaTeXXlate program would pass characters within a "markup" element
through unchanged, but would transform characters outside a "markup"
element so that when formatted with LaTeX they would print a
representation of that character.  For example, outside a "markup"
element, { and } would be output as \{ and \}, but inside they would be
output unchanged as { and }.

There are several ways this can be generalized...

James


 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.