Use data-include, file must now be served over http:, not file:
authorGavin Carothers <gavin@carothers.name>
Fri, 10 Jun 2011 14:56:46 -0700
changeset 36 482882d1bcb6
parent 35 9bc251715597
child 37 80c3a1657266
Use data-include, file must now be served over http:, not file:
rdf-turtle/index.html
--- a/rdf-turtle/index.html	Fri Jun 10 14:34:17 2011 -0700
+++ b/rdf-turtle/index.html	Fri Jun 10 14:56:46 2011 -0700
@@ -77,6 +77,12 @@
           doRDFa: true,
       };
     </script>
+    <script>
+    function updateExample(doc, content) {
+    // perform transformations to make it render and prettier
+    return '<pre class="example">' + doc._esc(content) + '</pre>';
+    }
+    </script>
         
     </head>
 
@@ -441,32 +447,13 @@
 			<p>Example (<a href="tests/test-30.ttl">test-30.ttl</a>) with document base URI 
 			http://www.w3.org/2001/sw/DataAccess/df1/tests/</p>
 
-			<pre class="example">
-# In-scope base URI is http://www.w3.org/2001/sw/DataAccess/df1/tests/ at this point
-&lt;test-00.ttl&gt; &lt;test-01.ttl&gt; &lt;test-02.ttl&gt; .
[email protected] &lt;http://example.org/ns/&gt; .
-# In-scope base URI is http://example.org/ns/ at this point
-&lt;a2&gt; &lt;http://example.org/ns/b2&gt; &lt;c2&gt; .
[email protected] &lt;foo/&gt; .
-# In-scope base URI is http://example.org/ns/foo/ at this point
-
-&lt;a3&gt; &lt;b3&gt; &lt;c3&gt; .
[email protected] : &lt;bar#&gt; .
-:a4 :b4 :c4 .
[email protected] : &lt;http://example.org/ns2#&gt; .
-:a5 :b5 :c5 .
+			<pre class="example" data-include="tests/text-30.ttl" data-oninclude="updateExample">
 			</pre>
 			<p>encodes the following N-Triples
 			(<a href="tests/test-30.out">test-30.out</a>):
 
 			</p>
-			<pre class="example">
-&lt;http://www.w3.org/2001/sw/DataAccess/df1/tests/test-00.ttl&gt; &lt;http://www.w3.org/2001/sw/DataAccess/df1/tests/test-01.ttl&gt; &lt;http://www.w3.org/2001/sw/DataAccess/df1/tests/test-02.ttl&gt; .
-&lt;http://example.org/ns/a2&gt; &lt;http://example.org/ns/b2&gt; &lt;http://example.org/ns/c2&gt; .
-&lt;http://example.org/ns/foo/a3&gt; &lt;http://example.org/ns/foo/b3&gt; &lt;http://example.org/ns/foo/c3&gt; .
-
-&lt;http://example.org/ns/foo/bar#a4&gt; &lt;http://example.org/ns/foo/bar#b4&gt; &lt;http://example.org/ns/foo/bar#c4&gt; .
-&lt;http://example.org/ns2#a5&gt; &lt;http://example.org/ns2#b5&gt; &lt;http://example.org/ns2#c5&gt; .
+			<pre class="example" data-include="tests/text-30.out" data-oninclude="updateExample">
 			</pre>
 
 			<p>The Turtle syntax for literals and blank nodes are defined by <a href="http://www.w3.org/TR/rdf-sparql-query/#QSynLiterals">SPARQL Query section 4.1.2</a> and <a href="http://www.w3.org/TR/rdf-sparql-query/#QSynBlankNodes">SPARQL Query section 4.1.4</a> respectively.</p>