<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#PXSL/FAQs'
         s:name='PXSL/FAQs'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:content>Here are the answers to oft-received PXSL questions.  If your question&#xD;&#xA;isn&apos;t answered below, please ask it in the [PXSL Ask-a-Question]&#xD;&#xA;section.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;1 Table of contents&#xD;&#xA;&#xD;&#xA;__General questions__&#xD;&#xA;    - What is PXSL?&#xD;&#xA;    - Does PXSL replace or compete with XML?&#xD;&#xA;    - What are your goals for PXSL?&#xD;&#xA;    - How does PXSL differ from other XML shorthands?&#xD;&#xA;    - Why does PXSL have a macro system?&#xD;&#xA;&#xD;&#xA;__Using PXSL__&#xD;&#xA;    - How can I convert existing XML documents into PXSL?&#xD;&#xA;    - How does pxslcc handle tabs in PXSL source documents?&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;1 General questions&#xD;&#xA;&#xD;&#xA;The follwing are questions about the PXSL project, why it is the way&#xD;&#xA;it is, and how it fits into the world.  If you want to know something&#xD;&#xA;about the PXSL tools, skip to the next section, &quot;Using PXSL,&quot; below.&#xD;&#xA;&#xD;&#xA;1.1 What is PXSL?&#xD;&#xA;&#xD;&#xA;PXSL is the Parsimonious XML Shorthand Language.  It provides XML&#xD;&#xA;authors and programmers with a simple, concise syntax that they can&#xD;&#xA;use to create XML documents.&#xD;&#xA;&#xD;&#xA;For more advanced users, PXSL offers customizable shortcuts and&#xD;&#xA;sophisticated refactoring tools like functional macros that can&#xD;&#xA;markedly reduce the size and complexity of markup-dense XML documents.&#xD;&#xA;But simplicity and consistency are the top priority.  The advanced&#xD;&#xA;features are hidden away until users are ready to use them.&#xD;&#xA;&#xD;&#xA;The official PXSL documentation and downloads are located at&#xD;&#xA;http://community.moertel.com/pxsl/ .&#xD;&#xA;(Source code and binary downloads are available.)&#xD;&#xA;&#xD;&#xA;1.1 Does PXSL replace or compete with XML?&#xD;&#xA;&#xD;&#xA;No.  PXSL is a shorthand for writing XML.  It does not replace or&#xD;&#xA;compete with XML.  Rather, it lets you write XML documents by using an&#xD;&#xA;alternative syntax that is more convenient for markup-dense&#xD;&#xA;applications, such as XSLT, Ant build files, or RDF.&#xD;&#xA;&#xD;&#xA;1.1 What are your goals for PXSL?&#xD;&#xA;&#xD;&#xA;PXSL was designed with the following goals in mind:&#xD;&#xA;&#xD;&#xA;- PXSL must be open source.&#xD;&#xA;- PXSL must be easy to read, write, and edit.&#xD;&#xA;- PXSL&apos;s syntax must be simple, consistent, and ~~concise.~~&#xD;&#xA;- PXSL must reduce markup and syntactical noise in data-centric XML documents.&#xD;&#xA;- Any feature that we add to PXSL must provide benefits that substantially outweigh the burden that the feature&apos;s addition places upon users. (Therefore, advanced features should be invisible until they are called upon to provide compelling benefits.)&#xD;&#xA;- It must be easy to intermix XML and PXSL within a single PXSL document.&#xD;&#xA;- PXSL must be extensible in order to allow sophisticated users and programmers to incorporate application-specific customizations and shortcuts.&#xD;&#xA;&#xD;&#xA;1.1 How does PXSL differ from other XML shorthands?&#xD;&#xA;&#xD;&#xA;There are at least a dozen other shorthands for XML and XML-like languages.&#xD;&#xA;Here are a few:&#xD;&#xA;&#xD;&#xA;- {link:DL|http://www.notdotnet.org/dl/}&#xD;&#xA;- {link:ONX|http://www.seairth.com/web/onx/onx.html}&#xD;&#xA;- {link:PYX|http://pyxie.sourceforge.net/}&#xD;&#xA;- {link:S(cheme)XML|http://okmij.org/ftp/Scheme/SXML-short-paper.html}&#xD;&#xA;- {link:SOX|http://www.langdale.com.au/SOX/} (Simple Outline XML)&#xD;&#xA;- {link:Tanga|http://wiki.truemesh.com/tanga/TangaSyntax} (project seems to have died)&#xD;&#xA;- {link:Terse XML|http://jsalz.net/txml/}&#xD;&#xA;- {link:XSLScript|http://www.pault.com/XSLScript/pault/prod/XSLScript}&#xD;&#xA;- {link:XSLtxt|http://savannah.gnu.org/projects/xsltxt}&#xD;&#xA;- {link:YAML|http://www.yaml.org/} (not isomorphic to XML)&#xD;&#xA;&#xD;&#xA;PXSL differs from these other shorthands in some or all of the following ways:&#xD;&#xA;&#xD;&#xA;- __PXSL combines simplicity, generality, extensibility, and constrained programmability__ into one cohesive language that complements rather than competes with XML.&#xD;&#xA;- __PXSL lets users intermix PXSL and XML syntax__ in one document.  Users are free to use whichever syntax works best for each portion of their documents.  (In other words, PXSL doesn&apos;t lock users into its syntax.)&#xD;&#xA;- __PXSL scales to the needs of each user.__  PXSL offers beginning users a simple, easy-to-understand shorthand that they can be productive with immediately.  Yet advanced users will find that PXSL provides a rich set of tools for constructing and refactoring complex, data-centric documents.  PXSL burdens neither class of users with the other&apos;s concerns.&#xD;&#xA;- __PXSL can be customized with application-specific shortcuts.__&#xD;&#xA;- __PXSL has a powerful hygienic macro system__ that can be used to build complicated document structures safely and conveniently.&#xD;&#xA;&#xD;&#xA;1.1 Why does PXSL have a macro system?&#xD;&#xA;&#xD;&#xA;In short, because the macro system has proven itself to be surprisingly useful.  (See, for example, {link:Refactoring XSLT one-offs with PXSL|http://www.kuro5hin.org/story/2003/6/4/12434/75716}.)&#xD;&#xA;&#xD;&#xA;The long answer is has to do with {link:XML&apos;s design goals|http://www.w3.org/TR/REC-xml#sec-origin-goals}, goals 4 and 10 in particular:&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;- 4. It shall be easy to write programs which process XML documents.&#xD;&#xA;- 10. Terseness in XML markup is of minimal importance.&#xD;&#xA;&#xD;&#xA;XML is syntactically noisy in order to make the job of&#xD;&#xA;writing programs that process XML easier.  The scales were&#xD;&#xA;tipped to make XML users carry more baggage so that XML implementors&#xD;&#xA;would have to carry less.  (And this was probably a good decision: If XML&#xD;&#xA;wasn&apos;t easy to implement, there would have been few initial&#xD;&#xA;implementations to attract the community of users that have made XML&#xD;&#xA;so popular today.)&#xD;&#xA;&#xD;&#xA;This design philosophy carries into many applications that are built&#xD;&#xA;on top of XML (e.g., XSLT).  In the same way that XML makes users&#xD;&#xA;write more markup in order to create any given bit of document&#xD;&#xA;structure, many XML-based applications make users create&#xD;&#xA;more document structure in order to express any given bit of&#xD;&#xA;application-specific data.  It&apos;s a double-whammy.&#xD;&#xA;&#xD;&#xA;PXSL, in contrast to XML, was designed with the opposite conviction:&#xD;&#xA;We (the guys creating PXSL) were willing to invest lots of time and&#xD;&#xA;effort in writing complicated parsers and processors, if it meant that&#xD;&#xA;the PXSL user&apos;s burden was correspondingly reduced.  We wanted to see&#xD;&#xA;how far we could tip the scales in the user&apos;s favor.&#xD;&#xA;&#xD;&#xA;PXSL&apos;s outline-based syntax does a good job of reducing the syntax verbosity that XML imposes, but it doesn&apos;t help with markup verbosity that many XML applications impose.&#xD;&#xA;That&apos;s what the macros are for.  PXSL lets you create small macros that&#xD;&#xA;create verbose application-specific structures for you.&#xD;&#xA;&#xD;&#xA;1 Using PXSL&#xD;&#xA;&#xD;&#xA;The following questions are about using PXSL and the PXSL tools, __pxslcc__ being the most prominent.&#xD;&#xA;&#xD;&#xA;1.1 How can I convert existing XML documents into PXSL?&#xD;&#xA;&#xD;&#xA;Included among the {link:PXSL sources|http://community.moertel.com/pxsl/sources/pxsl-0.9.1/} is an XSLT&#xD;&#xA;stylesheet called {link:xsl2pxsl.xsl|http://community.moertel.com/pxsl/sources/pxsl-0.9.1/xsl2pxsl.xsl}, written by Bill Hubauer.  It was originally created to&#xD;&#xA;convert XML-based XSLT stylesheets into PXSL (hence its name), but it&#xD;&#xA;works just as well as a general XML-to-PXSL convsion tool.  Its output isn&apos;t as crisp and compact as hand-written PXSL, but it&apos;s a good starting point if you are migrating an established repository to PXSL.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;1.1 How does pxslcc handle tabs in PXSL source documents?&#xD;&#xA;&#xD;&#xA;It doesn&apos;t.  It rejects them.&#xD;&#xA;&#xD;&#xA;Tabs are fragile, fickle things that often get lost or damaged in transit and mean different things in different computing environments.  Does a tab represent four spaces?  Eight?  Something else?  It depends.  There is no One Right Way.  For this reason, __pxslcc__ generates an error when it encounters tabs in the layout (indented) portions of documents.  (Yes, you ~~can~~ use tabs inside of text and mixed-content literals.)  &#xD;&#xA;&#xD;&#xA;The best advice I have is not to embed ASCII TAB characters in your documents.  If you must use them, expand them yourself before giving your documents to __pxslcc__.  That&apos;s what the Unix __expand__ utility is for:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;expand -4 myfile.pxsl | pxslcc &gt; myfile.xml&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;</s:content>
        <s:mTime>2007-12-17 22:53:21.723</s:mTime>
        <s:cTime>2006-06-15 12:45:43.485</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
                <rdf:li rdf:resource='#PXSL'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/PXSL/FAQs'/>
                <rdf:li rdf:resource='#pxsl'/>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/space/PXSL/FAQs'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/PXSL/FAQs'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tom&apos;s Perl code'/>
                <rdf:li rdf:resource='#LectroTest'/>
                <rdf:li rdf:resource='#RPMs'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#2004-03-24'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Talk - Haskell for Perl Hackers'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tom&apos;s Haskell code'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL/Changelog'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#start/'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#RPMs/'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#A Coder&apos;s Guide To Coffee'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#2004-03-18'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
