RE: Generating XProc/XSL with XProc/XSL

Tony,

As a follow-up to my last e-mail...

> human-friendly method of writing the "generator" code

This always gets messy. XSLT has some helpful features like namespace aliases that make the generating of XSLT much cleaner.


> human-friendly code produced by the "generator"

For de-bugging what you're generating this is certainly helpful but not a top priority as you should really be thinking too much about the machine generated code.


> flexible, modular code produced by the "generator"

If you are planning to re-use the generated code then you're, in my opinion, not looking at this from the right perspective. Generated code is generated code and was created for a specific purpose at a specific moment in time. It should be regarded as transitory and not to be re-used.


Regards

Philip

From: Philip Fennell [mailto:Philip.Fennell@marklogic.com]
Sent: Tuesday, February 21, 2012 10:33 AM
To: Tony R.; XProc Dev
Subject: RE: Generating XProc/XSL with XProc/XSL

Tony,

Are you wishing to create some mapping that will allow you to, for example, identify some piece(s) of data in some example documents that should be represented in a specific way in SVG?

Is your desire to define some abstraction that allows you to define these mappings for, potentially, many XML grammars and have some method of generating the necessary XSLT to implement the mapping?

Does your task basically require some means of binding the result of an XPath expression to a representation?

Is it a case that certain types of information require specific representations or should it be possible to declare an appearance as part of the binding process?

If you have a look at XForms you'll see that it provides the ability to bind data to controls that have potentially one of a number of representations. May be, you could look at that way of binding the data to the representation and then create some XSLT that transforms your description into working XSLT.



Regards

Philip



From: Tony R. [mailto:tony@gonk.net]
Sent: Wednesday, February 15, 2012 3:07 PM
To: XProc Dev
Subject: Generating XProc/XSL with XProc/XSL

Let's say I want to write some XSL templates that allow me to map arbitrary XML grammars into SVG.  I know what I want the SVG to look like, and I know that the intended XML grammar is guaranteed to have certain pieces of data that I want to map to SVG using XSL.

I've been in similar situations many times, but even with Oxygen (and I love Oxygen to bits-it's a fantastic IDE!) it can get tedious.

I have occasionally stumbled into the DocBook XSL files and seen comments stating "This is a generated XSL file-do not edit!"

...

How does one go about writing XProc or XSL to generate XSL?  I mean, how do you do it intelligently?  I'm looking for:


 *   human-friendly method of writing the "generator" code
 *   human-friendly code produced by the "generator"
 *   flexible, modular code produced by the "generator"

-Zearin (Tony)

Received on Tuesday, 21 February 2012 10:42:10 UTC