<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#Talks/Embedding+an+XHTML-template+language+into+Perl'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:name>Talks/Embedding an XHTML-template language into Perl</s:name>
        <s:content>\\&#xA;{image:pgh-pm-edsls.png|Title slide from my talk on EDSLs in Perl}&#xA;&#xA;I gave this brief talk for the {link:Pittsburgh Perl Mongers|http://pgh.pm.org/} on 2006-03-08.  The talk is about&#xA;embedding domain-specific languages into Perl.  The running&#xA;example is XHTML construction.&#xA;&#xA;You can download the slides here: {link:pgh-pm-edsls.pdf|http://community.moertel.com/~thor/talks/pgh-pm-edsls.pdf|img=none}&#xA;&#xA;Most of the ideas in the talk came from an earlier posting I made to the Perl Monks web site: {link:Embedding a mini-language for XML construction into Perl|http://perlmonks.org/?node_id=510000}. I would like to thank {link:Aristotle|http://perlmonks.org/?node_id=114691}, who contributed a nice syntax-simplification idea during the follow-up discussion.&#xA;&#xA;1.1 The EDSL&#xA;&#xA;The EDSL looks like this:&#xA;&#xA;{code:none}&#xA;html {&#xA;    head { &#xA;        title { &quot;My grand document!&quot; }&#xA;    };&#xA;    body {&#xA;        h1 { &quot;Heading&quot; };&#xA;        p {&#xA;            class_ &quot;first&quot;;       # attribute class=&quot;first&quot;&#xA;            text &quot;This is the first paragraph!&quot;;&#xA;            style_ &quot;font: bold&quot;;  # another attr&#xA;        };&#xA;        \# it&apos;s just Perl, so we can mix in other code&#xA;        for (2..5) {&#xA;            p { &quot;Plus paragraph number $_.&quot; }&#xA;        }&#xA;    };&#xA;};&#xA;{code}&#xA;&#xA;The embedded language renders into XHTML:&#xA;&#xA;{code:xml}&#xA;&lt;html&gt;&#xA;&lt;head&gt;&#xA;&lt;title&gt;My grand document!&lt;/title&gt;&#xA;&lt;/head&gt;&#xA;&lt;body&gt;&#xA;&lt;h1&gt;Heading&lt;/h1&gt;&#xA;&lt;p class=&quot;first&quot; style=&quot;font: bold&quot;&gt;This is the first paragraph!&lt;/p&gt;&#xA;&lt;p&gt;Plus paragraph number 2.&lt;/p&gt;&#xA;&lt;p&gt;Plus paragraph number 3.&lt;/p&gt;&#xA;&lt;p&gt;Plus paragraph number 4.&lt;/p&gt;&#xA;&lt;p&gt;Plus paragraph number 5.&lt;/p&gt;&#xA;&lt;/body&gt;&#xA;&lt;/html&gt;&#xA;{code}&#xA;</s:content>
        <s:mTime>2006-03-14 17:38:55.422</s:mTime>
        <s:cTime>2006-03-14 17:18:49.729</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='#Talks'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
                <rdf:li>
                    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#Talks/Embedding+an+XHTML-template+language+into+Perl'>
                        <s:attachments>
                            <rdf:Bag>
                                <rdf:li>
                                    <s:Attachment rdf:about='http://community.moertel.com/ss/space/Talks/Embedding+an+XHTML-template+language+into+Perl/pgh-pm-edsls.png'
                                         s:fileName='pgh-pm-edsls.png'
                                         s:contentType='image/png'
                                         s:size='6108'>
                                        <s:date>Tue Mar 14 17:26:10 EST 2006</s:date>
                                    </s:Attachment>
                                </rdf:li>
                            </rdf:Bag>
                        </s:attachments>
                    </s:Snip>
                </rdf:li>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/Talks/Embedding an XHTML-template language into Perl'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/Talks/Embedding an XHTML-template language into Perl'/>
                <rdf:li rdf:resource='#pxsl'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/space/space/Talks/Embedding an XHTML-template language into Perl'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <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#PXSL FAQs'/>
                <rdf:li rdf:resource='#LectroTest'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#Talk - Free Unit Tests In Perl with LectroTest'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#talks/embedding an xhtml-template language into perl'/>
                <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#Programming Fun Challenge'/>
            </rdf:Bag>
        </s:snipLinks>
    </s:Snip>
</rdf:RDF>
