RE: Generating XSL / XProc

Zearin,

> I'm interested in learning how to use XML tools to generate XSL and/or XProc
> Any other general advice, comments, suggestions on this topic?

There's no great trick to this as they are both XML documents you are generating. If you are generating XSLT with XSLT then the thing that makes it a lot easier is the use of namespace aliases:

<xsl:transform
                              xmlns:c="http://www.w3.org/ns/xproc-step"
                              xmlns:err="http://www.w3.org/ns/xproc-error"
                              xmlns:hp="http://code.google.com/p/half-pipe/"
                              xmlns:p="http://www.w3.org/ns/xproc"
                              xmlns:saxon="http://saxon.sf.net/"
                              xmlns:xproc="http://www.w3.org/ns/xproc"
                              xmlns:xs="http://www.w3.org/2001/XMLSchema"
                              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:XSLT="http://www.w3.org/1999/XSL/Transform/output"
                              exclude-result-prefixes="c"
                              version="2.0">

               <xsl:namespace-alias stylesheet-prefix="XSLT" result-prefix="xsl"/>


               <!-- Creates input port parameters for step templates. -->
               <xsl:template match="p:input" mode="xproc:step-inputs">
                              <XSLT:param name="input-{@port}" as="element(){hp:sequenceQualifier(.)}" tunnel="yes"/>
               </xsl:template>


The above code fragment is taken from an XSLT transform that takes an XProc pipeline as input and generates an XSLT transform that 'implements' that pipeline. Note the declaration of the XSLT namespace prefix and its alias declaration. Where ever you want to generate an XSLT element in your result document you need to use the XSLT instead of the xsl prefix which is, of course, part of the transform that's generating the XSLT result document.


Regards

Philip



From: Zearin [mailto:zearin@gonk.net]
Sent: Wednesday, January 04, 2012 3:08 PM
To: XProc Dev
Subject: Generating XSL / XProc

I'm interested in learning how to use XML tools to generate XSL and/or XProc (code skeletons are just fine-anything extra is a delightful bonus).


 *   Are there documents that teach how to do this?
 *   Are there existing tools available for accomplishing this?
 *   Any other general advice, comments, suggestions on this topic?

Thanks!

-Zearin
    (Tony)

Received on Wednesday, 4 January 2012 15:37:35 UTC