Parsimonious Xml Shorthand Language

The Parsimonious XML Shorthand Language (PXSL or pixel) is a convenient shorthand for writing markup-heavy XML documents (ExtensibleMarkupLanguage). Created by TomMoertel.

There is a program written in HaskellLanguage 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 (MathMl) taken from http://community.moertel.com/pxsl/

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 http://community.moertel.com/pxsl/ for more details).

It is also allowed to have XML in PXSL.

There is a longer example of useage here: http://www.kuro5hin.org/story/2003/6/4/12434/75716


How about :-)

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


On WikiPedia (http://en.wikipedia.org/wiki/MathML#Content_MathML) is the example for

 ax^2 + bx + c

in content MathMl

 <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.


CategoryXml MarkupLanguage


EditText of this page (last edited September 12, 2010) or FindPage with title or text search