Handling verbosity

It's nice to hear about the XProc support in oXygen, and there's a couple of
visual editors for XProc...

On the command-line side:
In case any of you out there use PXSL[1], I've made a list of default
shortcuts for use with XProc, up at:
http://www.portlanddatasystems.com/projects/xproc.edf

PXSL is a shorthand for XML which brackets the text rather than the element
names (makes sense in element-dominated documents), and uses whitespace
indentation rather than closing tags to control nesting.  If you're familiar
with Haml you've seen this before.  I already use it all the time for
writing XSLT stylesheets, and it has built-ins for that; this is just the
equivalent of those built-ins for XProc.  PXSL can be used fine without that
shortcuts list I made - that list just adds "p:" namespace prefixes, and
adds some default parameters so you can say "input source //title" rather
than "p:input -port=source -select=//title".

The general idea is that you would write this:


> declare-step xquery-test -xmlns:p=http://www.w3.org/ns/xproc -xmlns:c=
> http://www.w3.org/ns/xproc-step
>   input parameters -kind=parameter
>   input source
>   output result
>
>   xquery
>     input query
>       inline
>         c:query
>           <{ <elem>5</elem> }>
>

which when processed as pxslcc -a xproc.edf query.pxsl > query.xpl
becomes this:

<p:declare-step name="xquery-test" xmlns:p="http://www.w3.org/ns/xproc"
> xmlns:c="http://www.w3.org/ns/xproc-step">
>   <p:input port="parameters" kind="parameter"/>
>   <p:input port="source"/>
>   <p:output port="result"/>
>
>   <p:xquery>
>     <p:input port="query">
>       <p:inline>
>         <c:query> &lt;elem>5&lt;/elem> </c:query>
>       </p:inline>
>     </p:input>
>   </p:xquery>
> </p:declare-step>
>

PXSL works for XML in general, as well.  I write web pages that way.
Bad news is you lose syntax highlighting support writing that way.  I have a
little thing for vim to fix that I've been working on.

[1] http://community.moertel.com/pxsl/

Received on Monday, 21 September 2009 01:02:54 UTC