Parsimonious Xml Shorthand Language

The Parsimonious XML Shorthand Language (PXSL or pixel) is a convenient shorthand for writing markup-heavy XML documents (Extensible Markup Language). Created by Tom Moertel.

There is a program written in Haskell Language which will translate from PXSL to XML. The idea is that PXSL is much easier to edit and so the user can maintain a file in PXSL which is translated when needed into XML.

The web pages referenced here have some examples. Here is one for MathML (Math Ml) taken from community.moertel.com

MathML example in XML

<declare type="fn"> <ci> f </ci> <lambda> <bvar><ci> x </ci></bvar> <apply> <plus/> <apply> <power> <ci> x </ci> <cn> 2 </cn> </apply> <ci> x </ci> <cn> 3 </cn> </apply> </lambda> </declare>

MathML example in PXSL

declare -type=fn ci << f >> lambda bvar ci << x >> apply plus apply power ci << x >> cn << 2 >> ci << x >> cn << 3 >>

And the obvious question is: How does PXSL handle namespaces? And how CDATA? Any examples for that?

It has a structure for CDATA (see community.moertel.com for more details).

XML:

PXSL: <{ toast & jelly }>

It is also allowed to have XML in PXSL.

There is a longer example of useage here: www.kuro5hin.org


How about :-)

fn(f, lambda( bvar(x) x^2 + x + 3 ) )


On Wiki Pedia (en.wikipedia.org ) is the example for

ax^2 + bx + c

in content Math Ml

<math> <apply> <plus/> <apply> <times/> <ci>a</ci> <apply> <power/> <ci>x</ci> <cn>2</cn> </apply> </apply> <apply> <times/> <ci>b</ci> <ci>x</ci> </apply> <ci>c</ci> </apply> </math>

The following PXSL will generate the same XML:

math apply plus apply times ci <<a>> apply power ci <<x>> cn <<2>> apply times ci <<b>> ci <<x>> ci <<c>>

using the tool pxslcc which can be downloaded.


See original on c2.com