<?xml version="1.0" encoding="UTF-8"?>


<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns5="http://purl.org/dc/terms/" xmlns:ns3="http://lojjic.net/ns/rdf/comments/" xmlns:ns2="http://lojjic.net/ns/rdf/blog/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<rdf:Description rdf:about="http://lojjic.net/blog/20040123-114122">
	<ns2:entry-date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2004-01-23T11:41:23-07:00</ns2:entry-date>
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/ns/rdf/blog/entry-date">
	<rdfs:domain rdf:resource="http://lojjic.net/ns/rdf/blog/Entry" />
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/blog/20040123-114122">
	<rdf:type rdf:resource="http://lojjic.net/ns/rdf/blog/Entry" />
	<ns2:entry-title rdf:datatype="http://www.w3.org/2001/XMLSchema#normalizedString">Accessible Email Obfuscation in XBL</ns2:entry-title>
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/ns/rdf/blog/entry-title">
	<rdfs:domain rdf:resource="http://lojjic.net/ns/rdf/blog/Entry" />
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/blog/20040123-114122">
	<ns2:entry-content rdf:parseType="Literal"><p xmlns="http://www.w3.org/1999/xhtml">I&apos;ve been fooling around a lot with <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.mozilla.org/catalog/architecture/xbl/"><acronym xmlns="http://www.w3.org/1999/xhtml" title="eXtensible Binding Language">XBL</acronym></a> recently, and have converted my <a xmlns="http://www.w3.org/1999/xhtml" href="http://lojjic.net/blog/20030828-142754.rdf.html">Accessible Email Obfuscation</a> script into an XBL binding.  Here&apos;s the binding, which would be saved as an XML file such as <kbd xmlns="http://www.w3.org/1999/xhtml">EmailLink.xml</kbd>:</p>
<pre xmlns="http://www.w3.org/1999/xhtml"><code xmlns="http://www.w3.org/1999/xhtml">&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;bindings xmlns=&quot;http://www.mozilla.org/xbl&quot; xmlns:h=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
   &lt;binding id=&quot;email-address&quot;&gt;
      &lt;implementation&gt;
         &lt;field name=&quot;email&quot;&gt;
            var txt = this.firstChild;
            if(txt.nodeType!=3) txt=txt.firstChild; //if anon. content not supported
            txt.nodeValue.replace(/[ \[\{\(\|\/\\]at[ \]\}\)\|\/\\]/i, &quot;@&quot;)
               .replace(/[ \[\{\(\|\/\\](dot|period|point)[ \]\}\)\|\/\\]/gi, &quot;.&quot;);
         &lt;/field&gt;
         &lt;constructor&gt;
            var lnk = document.getAnonymousNodes(this)[1];
            lnk.setAttribute(&quot;href&quot;, &quot;mailto:&quot;+this.email);
            lnk.firstChild.nodeValue = this.getAttribute(&quot;title&quot;) || this.email;
         &lt;/constructor&gt;
      &lt;/implementation&gt;
      &lt;content&gt;
         &lt;h:span style=&quot;display:none&quot;&gt;&lt;children /&gt;&lt;/h:span&gt;
         &lt;h:a href=&quot;&quot;&gt;-&lt;/h:a&gt;
      &lt;/content&gt;
   &lt;/binding&gt;
&lt;/bindings&gt;</code></pre>
<p xmlns="http://www.w3.org/1999/xhtml">Then in your HTML page you would insert the email address in obfuscated form:</p>
<pre xmlns="http://www.w3.org/1999/xhtml"><code xmlns="http://www.w3.org/1999/xhtml">&lt;span class=&quot;mail&quot;&gt;jj/at/lojjic\period\net&lt;/span&gt;</code></pre>
<p xmlns="http://www.w3.org/1999/xhtml">And then you attach the XBL binding to that element using CSS:</p>
<pre xmlns="http://www.w3.org/1999/xhtml"><code xmlns="http://www.w3.org/1999/xhtml">.mail {-moz-binding:url(EmailLink.xml#email-address)}</code></pre>
<p xmlns="http://www.w3.org/1999/xhtml">The advantage of this approach is that you don&apos;t have to include any script in your page, and since it&apos;s attached using CSS you have the full power of CSS selectors for choosing which elements it applies to. Of course, it only works in Mozilla (for the time being...)</p></ns2:entry-content>
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/ns/rdf/blog/entry-content">
	<rdfs:domain rdf:resource="http://lojjic.net/ns/rdf/blog/Entry" />
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/blog/20040123-114122">
	<ns3:allow-comments rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</ns3:allow-comments>
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/ns/rdf/comments/allow-comments">
	<rdfs:domain rdf:resource="http://lojjic.net/ns/rdf/comments/CommentableResource" />
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/blog/20040123-114122">
	<rdf:type rdf:resource="http://lojjic.net/ns/rdf/comments/CommentableResource" />
	<ns3:comments rdf:nodeID="node14dadkou5x81" />
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/ns/rdf/comments/comments">
	<rdfs:domain rdf:resource="http://lojjic.net/ns/rdf/comments/CommentableResource" />
</rdf:Description>

<rdf:Description rdf:nodeID="node14dadkou5x81">
	<rdf:_4 rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040125-040404" />
	<rdf:_3 rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040124-162224" />
	<rdf:_2 rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040123-223921" />
	<rdf:_1 rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040123-221152" />
	<rdf:type rdf:resource="http://lojjic.net/ns/rdf/comments/CommentList" />
	<rdf:_5 rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20051103-201638" />
	<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource" />
	<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq" />
	<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Container" />
	<rdfs:member rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040123-221152" />
	<rdfs:member rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040125-040404" />
	<rdfs:member rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040124-162224" />
	<rdfs:member rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20040123-223921" />
	<rdfs:member rdf:resource="http://lojjic.net/blog/20040123-114122/comment-20051103-201638" />
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/blog/20040123-114122">
	<ns5:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#long">1139767943</ns5:modified>
</rdf:Description>

<rdf:Description rdf:about="http://purl.org/dc/terms/modified">
	<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource" />
</rdf:Description>

<rdf:Description rdf:about="http://lojjic.net/blog/20040123-114122">
	<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource" />
</rdf:Description>

<rdf:Description rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
	<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource" />
</rdf:Description>

</rdf:RDF>
