<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+Ask-a-Question'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:name>PXSL Ask-a-Question</s:name>
        <s:content>If you have a question that isn&apos;t answered elsewhere, please ask it below.  (You&apos;ll have to register first. Sorry about that.) We&apos;ll do our best to answer promptly.&#xA;&#xA;If for some reason you don&apos;t want to register or ask your question in a public forum, feel free to send me email at {link:tom@moertel.com|mailto:tom@moertel.com}.&#xA;&#xA;1.1 Probs on MacOSX, Drift Sources &#xA;see: [PXSL Ask-a-Question/MacOSX, ghc 6.4 , Drift Sources]&#xA;&#xA;</s:content>
        <s:mTime>2006-07-15 00:40:43.805</s:mTime>
        <s:cTime>2003-06-10 17:19:07.664</s:cTime>
        <s:comments>
            <rdf:Bag>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-1'
                         s:cUser='ucblockhead'
                         s:oUser='tmoertel'
                         s:mUser='ucblockhead'>
                        <s:name>comment-PXSL Ask-a-Question-1</s:name>
                        <s:content>I&apos;ve been playing around with PXSL and have noticed that it barfs on tabs.  Is this intentional?</s:content>
                        <s:mTime>2003-06-13 15:34:58.536</s:mTime>
                        <s:cTime>2003-06-13 15:35:00.024</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-2'
                         s:cUser='tmoertel'
                         s:oUser='tmoertel'
                         s:mUser='tmoertel'>
                        <s:name>comment-PXSL Ask-a-Question-2</s:name>
                        <s:content>Yes. Tabs are evil as far is PXSL (and most layout-driven syntaxes) are concerned.  Either you pick a fixed tab width, which hoses (perhaps silently) the camp of folks who don&apos;t agree with your choice, or you disallow them altogether, which is what PXSL does.&#xA;&#xA;How do you think that PXSL ought to handle tabs?</s:content>
                        <s:mTime>2003-06-13 16:46:13.352</s:mTime>
                        <s:cTime>2003-06-13 16:46:18.424</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-3'
                         s:cUser='tmoertel'
                         s:oUser='tmoertel'
                         s:mUser='tmoertel'>
                        <s:name>comment-PXSL Ask-a-Question-3</s:name>
                        <s:content>One more thing on tabs: If you have a Unix-like environment (e.g., {link:Cygwin|http://www.cygwin.com/} on Windows), you can use the __expand__ command to &quot;detabify&quot; your files.  It converts each tab into the appropriate number of spaces.  For example, if your editing environment placed a tab stop every four spaces, you could detabify your files like so:&#xA;&#xA;{code}&#xA;expand -4 tabs.txt &gt; no-tabs.txt&#xA;{code}&#xA;&#xA;Or, more to the point:&#xA;&#xA;{code}&#xA;expand -4 myfile.pxsl | pxslcc &gt; myfile.xml&#xA;{code}&#xA;&#xA;Nevertheless, I still recommend not having any tabs in your source files because tabs are fragile, fickle things.</s:content>
                        <s:mTime>2003-06-13 23:47:11.096</s:mTime>
                        <s:cTime>2003-06-13 17:14:38.568</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-4'
                         s:cUser='invisible'
                         s:oUser='tmoertel'
                         s:mUser='invisible'>
                        <s:name>comment-PXSL Ask-a-Question-4</s:name>
                        <s:content>Tom,&#xA;&#xA;PXSL is very very well done.  Quite aside from the fact that XSLT is finally somewhat readable, the fact that you&apos;ve added a serious macro system means&#xA;that some serious scripting of XML can occur.  I&apos;m very impressed.  So far&#xA;I&apos;ve been able to do everything I try to do -- except one thing.&#xA;&#xA;To wit: I would like to have a macro such that:&#xA;&#xA;  ,command c a1 a2 a3&#xA;&#xA;produces&#xA;&#xA;  &lt;a href=&quot;c?a1=,a1&amp;a2=,a2&amp;a3=a3&quot;&gt;,BODY&lt;/a&gt;&#xA;&#xA;In other words I would like to have macro parameters appear in an attribute&#xA;&#xA;However I can&apos;t find a way to do it.  The &apos;-attribute=&apos; syntax binds too&#xA;tightly, and there&apos;s nothing I can pass to -href= that doesn&apos;t instantly&#xA;get treated as a single string.  The closest I&apos;ve gotten is:&#xA;&#xA;,command c a1 a2 a3 =&#xA;  a -href=&lt;( ,command &lt;&lt;?a1=&gt;&gt; a1 &lt;&lt;&amp;a2=&gt;&gt; a2 &lt;&lt;&amp;a3=&gt;&gt; a3 )&gt;&#xA;&#xA;which for &apos;,command -a1=s1 -a2=s2 -a3=s3&apos; at least produces &apos;&lt;a href=&quot;command&quot;&gt;&apos;&#xA;But that&apos;s it.  Can&apos;t get past the first string.&#xA;&#xA;I imagine the current implementation cannot do what I&apos;m trying to do.&#xA;But do you see the utility of it?&#xA;&#xA;Thanks for any help.  And thanks muchly for a very nice tool.</s:content>
                        <s:mTime>2004-01-03 01:53:39.512</s:mTime>
                        <s:cTime>2004-01-03 01:53:41.704</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-5'
                         s:cUser='tmoertel'
                         s:oUser='tmoertel'
                         s:mUser='tmoertel'>
                        <s:name>comment-PXSL Ask-a-Question-5</s:name>
                        <s:content>First, thanks for the kind words about PXSL.&#xA;&#xA;Second, good question.  And, I have the answer you are looking for: Yes, you can do this in stock PXSL.  The key is to remember that the &lt;( )&gt; delimiters open a full ~~pxsl-fragment~~, which lets you include any number of statements into an argument value.  The results of the statements are concatenated to yield the final argument value.&#xA;&#xA;With that in mind, here&apos;s one solution:&#xA;&#xA;{code:none}&#xA;,command c a1 a2 a3 =&#xA;  a -href=&lt;( ,c&#xA;             &lt;&lt;?a1=&gt;&gt;&#xA;             ,a1&#xA;             &lt;&lt;&amp;a2=&gt;&gt;&#xA;             ,a2&#xA;             &lt;&lt;&amp;a3=&gt;&gt;&#xA;             ,a3      )&gt;&#xA;&#xA;    ,BODY&#xA;&#xA;,command cmd param1 param2 param3&#xA;  &lt;&lt;My command link&gt;&gt;&#xA;{code}&#xA;&#xA;which produces the following output when processed with __pxslcc -i__:&#xA;&#xA;{code:xml}&#xA;&lt;a href=&quot;cmd?a1=param1&amp;amp;a2=param2&amp;amp;a3=param3&quot;&gt;My command link&lt;/a&gt;&#xA;{code}&#xA;&#xA;Strictly speaking, we ought to rewrite the above output so that bare ampersands don&apos;t appear in the CDATA value of the ~~href~~ attribute:&#xA;&#xA;{code:xml}&#xA;&lt;a href=&quot;cmd?a1=param1&amp;amp;amp;a2=param2&amp;amp;amp;a3=param3&quot;&gt;My command link&lt;/a&gt;&#xA;&#xA;{code}&#xA;&#xA; While ampersands are fine in URLs, they ought not to appear unescaped in URLs placed inside of attribute values. Fortunately, we can use PXSL&apos;s &lt;\{ \}&gt; delimiters to take care of the escaping for us automatically.&#xA;&#xA;Also, to make the code&apos;s workings a little more obvious, we could factor out the portion that builds the argument body and compact the lines where the arguments&apos; names and values are joined.  Thus we end up with the following, final version of our macro:&#xA;&#xA;{code:none}&#xA;,command c a1 a2 a3 =&#xA;&#xA;  a -href=&lt;(,hrefval)&gt;&#xA;    ,BODY&#xA;&#xA;  \# build href value from arguments&#xA;  ,hrefval =&#xA;    ,c&#xA;    &lt;{?a1=}&gt; ,a1&#xA;    &lt;{&amp;a2=}&gt; ,a2&#xA;    &lt;{&amp;a3=}&gt; ,a3&#xA;{code}&#xA;&#xA;&#xA;&#xA;&#xA;</s:content>
                        <s:mTime>2004-12-10 16:13:10.586</s:mTime>
                        <s:cTime>2004-01-07 16:24:13.624</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-6'
                         s:cUser='Chris'
                         s:oUser='tmoertel'
                         s:mUser='Chris'>
                        <s:name>comment-PXSL Ask-a-Question-6</s:name>
                        <s:content>Impressive. It&apos;s good to see functional programming out in the wild.&#xA;&#xA;I&apos;m developing a tool which parses XML to create Swing users interfaces.&#xA;&#xA;I converted some of my files from XML to PXSL and the readability was much improved.&#xA;&#xA;I&apos;m looking forward to playing with the macro system.&#xA;&#xA;Thanks. </s:content>
                        <s:mTime>2004-03-12 22:34:58.304</s:mTime>
                        <s:cTime>2004-03-12 22:34:36.632</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-7'
                         s:cUser='tmoertel'
                         s:oUser='tmoertel'
                         s:mUser='tmoertel'>
                        <s:name>comment-PXSL Ask-a-Question-7</s:name>
                        <s:content>Thanks for the friendly words about PXSL.&#xA;&#xA;After you use it for a while, please let me know what you think, good or bad. If you find anything confusing, let me know. If the docs are hard to understand, let me know. If you have any suggestions for improvement, please let me know.&#xA;&#xA;Cheers,\\&#xA;Tom </s:content>
                        <s:mTime>2004-03-12 22:35:19.456</s:mTime>
                        <s:cTime>2004-03-12 22:35:20.336</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-8'
                         s:cUser='Chris'
                         s:oUser='tmoertel'
                         s:mUser='Chris'>
                        <s:name>comment-PXSL Ask-a-Question-8</s:name>
                        <s:content>I came across roughly the same issue as Mr. invisible. You might want to consider putting an example in the docs.&#xA;&#xA;I have a question:&#xA;&#xA;How can I pass a sequence of one or more attribute name-value-pairs to a macro? I imagine that I might want something like a varargs macro.&#xA;&#xA;Thanks again. </s:content>
                        <s:mTime>2004-03-12 22:35:38.6</s:mTime>
                        <s:cTime>2004-03-12 22:35:38.04</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-9'
                         s:cUser='tmoertel'
                         s:oUser='tmoertel'
                         s:mUser='tmoertel'>
                        <s:name>comment-PXSL Ask-a-Question-9</s:name>
                        <s:content>Can you give me an example of where you might want varargs-like behavior? The reason I ask is because if there is a real need for it, I want to understand the root cause. Perhaps there is a more general way to support that need, and in doing so support other needs that varargs alone cannot.</s:content>
                        <s:mTime>2004-03-12 22:35:53.928</s:mTime>
                        <s:cTime>2004-03-12 22:35:53.784</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-10'
                         s:cUser='Chris'
                         s:oUser='tmoertel'
                         s:mUser='Chris'>
                        <s:name>comment-PXSL Ask-a-Question-10</s:name>
                        <s:content>(This doesn&apos;t necessary relate to my previous question, but it&apos;s in the same ballpark.)&#xA;&#xA;I&apos;d like to be able to have (something like, modulo markup) this:&#xA;&#xA;,defs = -a=b -c=d -e=f ...&#xA;&#xA;foo ,defs -test=true&#xA;&#xA;compile to:&#xA;&#xA;&lt;foo a=&quot;b&quot; c=&quot;d&quot; e=&quot;f&quot; ? test=&quot;true&quot;/&gt;&#xA;&#xA;Thanks. </s:content>
                        <s:mTime>2004-03-12 22:36:12.704</s:mTime>
                        <s:cTime>2004-03-12 22:36:15.04</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-11'
                         s:cUser='tmoertel'
                         s:oUser='tmoertel'
                         s:mUser='tmoertel'>
                        <s:name>comment-PXSL Ask-a-Question-11</s:name>
                        <s:content>I see. Right now, you can&apos;t splice attributes with stock PXSL, so you&apos;re ought of luck. (But you can assemble attribute ~~values,~~ as the earlier examples show. Not that it helps with your situation.)&#xA;&#xA;Let me think about the options.</s:content>
                        <s:mTime>2004-03-12 22:36:30.76</s:mTime>
                        <s:cTime>2004-03-12 22:36:30.576</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-12'
                         s:cUser='Chris'
                         s:oUser='tmoertel'
                         s:mUser='Chris'>
                        <s:name>comment-PXSL Ask-a-Question-12</s:name>
                        <s:content>Thanks for the answer.&#xA;&#xA;That&apos;s what I thought.&#xA;&#xA;It&apos;s a &quot;would be nice to have&quot; rather than a &quot;must have&quot; for me. </s:content>
                        <s:mTime>2004-03-12 22:36:43.848</s:mTime>
                        <s:cTime>2004-03-12 22:36:45.872</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-13'
                         s:cUser='Chris'
                         s:oUser='tmoertel'
                         s:mUser='Chris'>
                        <s:name>comment-PXSL Ask-a-Question-13</s:name>
                        <s:content>It seems that pxslcc exits with success (0) even on a parse error.</s:content>
                        <s:mTime>2004-03-12 22:37:06.12</s:mTime>
                        <s:cTime>2004-03-12 22:37:05.288</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-14'
                         s:cUser='tmoertel'
                         s:oUser='tmoertel'
                         s:mUser='tmoertel'>
                        <s:name>comment-PXSL Ask-a-Question-14</s:name>
                        <s:content>Oops! Good catch, Chris.&#xA;&#xA;I have uploaded a quick-fix version 0.9.2 ({link:source|http://community.moertel.com/pxsl/sources/} and {link:RPMs|http://community.moertel.com/pxsl/RPMS/}) that should fix the problem. Please let me know if you have any difficulties with it.&#xA;&#xA;</s:content>
                        <s:mTime>2004-03-12 22:37:49.816</s:mTime>
                        <s:cTime>2004-03-12 22:37:48.28</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://community.moertel.com/ss/rdf#comment-PXSL+Ask-a-Question-15'
                         s:cUser='Chris'
                         s:oUser='tmoertel'
                         s:mUser='Chris'>
                        <s:name>comment-PXSL Ask-a-Question-15</s:name>
                        <s:content>Great, thanks.</s:content>
                        <s:mTime>2004-03-12 22:38:10.648</s:mTime>
                        <s:cTime>2004-03-12 22:38:11.616</s:cTime>
                        <s:commentedSnip rdf:resource='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'/>
                    </s:Comment>
                </rdf:li>
            </rdf:Bag>
        </s:comments>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#PXSL'/>
                <rdf:li rdf:resource='#pxsl'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL FAQs'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/PXSL Ask-a-Question'/>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='#LectroTest'/>
                <rdf:li>
                    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#PXSL+Ask-a-Question'>
                        <s:attachments
                             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
                    </s:Snip>
                </rdf:li>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#pxsl/'/>
                <rdf:li rdf:resource='#RPMs'/>
                <rdf:li rdf:resource='#snipsnap-help'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL Examples'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#IMDB Movie-Rating Decoder Ring'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL Feedback'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#2003-06-12'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL/FAQs'/>
                <rdf:li rdf:resource='#stephan'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#PXSL/Links'/>
                <rdf:li rdf:resource='#snipsnap-portlet-1'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#A Coder&apos;s Guide To Coffee'/>
                <rdf:li rdf:resource='#qualf'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tom&apos;s Perl code'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#MacOSX, ghc 6.4 , Drift Sources'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#2003-07-12'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Programming Fun Challenge'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Tech Recipes'/>
                <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#Tom&apos;s Haskell code'/>
                <rdf:li rdf:resource='#snipsnap-notfound'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#RPMs/'/>
                <rdf:li rdf:resource='#dprotti'/>
            </rdf:Bag>
        </s:snipLinks>
    </s:Snip>
</rdf:RDF>
