XML and HTML
Cross-Pollination:
A Bridge Too Far?

HTML/XML Task Force

Cross-Pollination

XML in the browser

<?xml-stylesheet href="xmltest.css"?>
<doc>
  <title>Title</title>
  <para xml:id="test">Testing.</para>
</doc>

XML in the browser

XML in the browser: Scripting

<?xml-stylesheet href="xmltest.css"?>
<doc>
<title>Title</title>
<para xml:id="test">Testing.</para>

<script xmlns="http://www.w3.org/1999/xhtml">
//<![CDATA[
var txt = document.createTextNode("Script test");
var p = document.getElementsByTagName("para")[0];
p.replaceChild(text, p.firstChild)
//]]></script>
</doc>

XML in the browser: Scripting (continued)

XML in the browser: Linking

XML in the browser: Accessibility

XML in the browser

XPointer and CSS

XPointer and CSS: Examples

Implementing FO

Compilation to JS

SVG's Switch

Distributed Extensibility

JS-SLT

JS-SLT: Code

var sheet = require("jaspilite").sheet()
,   $     = require("jquery");
sheet.template("section", function () {
    return $(this)
              .apply()
              .wrapIn("<div class='section'/>");
});
var $out = sheet.run("my-document.html");
console.log($out.html());
      

Schemata on the Web

CSS Schema!

CSS Schema: Code

@rule head {
  title {
      assert:  "Page does not have a title.";
  }
}
@rule body {
  :scope > div.std-top {
      assert:   "Missing page top component.";
  }
}

Conclusions

Conclusions (2)

Questions?

Thanks!