]> granicus.if.org Git - docbook-dsssl/commitdiff
fix issue #40 Add support for RDFalite attributes snapshot/2018-09-29-177
authorbobstayton <bobs@sagehill.net>
Sun, 22 Jul 2018 06:21:01 +0000 (23:21 -0700)
committerbobstayton <bobs@sagehill.net>
Sat, 29 Sep 2018 01:20:31 +0000 (18:20 -0700)
xsl/html/html.xsl
xsl/html/param.ent
xsl/html/param.xweb
xsl/params/copy.rdfa.attributes.xml [new file with mode: 0644]

index aa0b90603217c0176c9a6b56ad4625061622d4df..b55e2b90858190e59a93c2e658f0653fe7485bd1 100644 (file)
     <xsl:with-param name="class" select="$class"/>
     <xsl:with-param name="inherit" select="$inherit"/>
   </xsl:apply-templates>
+  <xsl:if test="$copy.rdfa.attributes != 0">
+    <!-- copy through any RDFA attributes -->
+    <xsl:apply-templates select="." mode="rdfa.html.attributes"/>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template match="*" mode="common.html.attributes">
   <xsl:call-template name="its.attributes"/>
 </xsl:template>
 
+<xsl:template match="*" mode="rdfa.html.attributes">
+  <xsl:copy-of select="@vocab"/>
+  <xsl:copy-of select="@typeof"/>
+  <xsl:copy-of select="@property"/>
+  <xsl:copy-of select="@resource"/>
+  <xsl:copy-of select="@prefix"/>
+</xsl:template>
+
 <!-- Pass through any lang attributes -->
 <xsl:template name="generate.html.lang">
   <xsl:apply-templates select="." mode="html.lang.attribute"/>
index ccaf16579a947d55ae59414a2dc46102919c5ba9..5fa849d28830a1fadc5f75d1819de638f07f6f01 100644 (file)
 <!ENTITY webhelp.tree.cookie.id     SYSTEM "../params/webhelp.tree.cookie.id.xml">
 <!ENTITY activate.external.olinks     SYSTEM "../params/activate.external.olinks.xml">
 <!ENTITY autolink.index.see         SYSTEM "../params/autolink.index.see.xml">
+<!ENTITY copy.rdfa.attributes       SYSTEM "../params/copy.rdfa.attributes.xml">
index f1b31383c70f0bbac06c3775428d88eaa10d3ebe..644d39ea9c42ba05a37095730fa49143fad192ca 100644 (file)
 &generate.revhistory.link;
 &html.head.legalnotice.link.types;
 &html.head.legalnotice.link.multiple;
+&copy.rdfa.attributes;
 </reference>
 <reference xml:id="refentry"><title>Reference Pages</title>
 &funcsynopsis.decoration;
@@ -502,6 +503,7 @@ around all these parameters.</para>
 <src:fragref linkend="collect.xref.targets.frag"/>
 <src:fragref linkend="component.label.includes.part.label.frag"/>
 <src:fragref linkend="contrib.inline.enabled.frag"/>
+<src:fragref linkend="copy.rdfa.attributes.frag"/>
 <src:fragref linkend="css.decoration.frag"/>
 <src:fragref linkend="current.docid.frag"/>
 <src:fragref linkend="custom.css.source.frag"/>
diff --git a/xsl/params/copy.rdfa.attributes.xml b/xsl/params/copy.rdfa.attributes.xml
new file mode 100644 (file)
index 0000000..d1397f8
--- /dev/null
@@ -0,0 +1,42 @@
+<refentry xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:xi="http://www.w3.org/2001/XInclude"
+          xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
+          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+          version="5.0" xml:id="copy.rdfa.attributes">
+<refmeta>
+<refentrytitle>copy.rdfa.attributes</refentrytitle>
+<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>copy.rdfa.attributes</refname>
+<refpurpose>Copy RDFA attributes to HTML output</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment xml:id="copy.rdfa.attributes.frag">
+<xsl:param name="copy.rdfa.attributes" select="1"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsection><info><title>Description</title></info>
+
+<para>RDFa (or Resource Description Framework in Attributes) is a
+W3C Recommendation that adds a set of attribute-level extensions
+to HTML, XHTML and various XML-based document types for
+embedding rich metadata within Web documents. RDFa Lite is a
+core subset of attributes also defined as a W3C Recommendation.</para>
+
+<para>DocBook 5.1 added support for the RDFa Lite attributes to
+the DocBook schema.  Those attributes are <tag>vocab</tag>,
+<tag>typeof</tag>, <tag>property</tag>, <tag>resource</tag>,
+<tag>prefix</tag>.</para>
+
+<para>If the parameter <parameter>copy.rdfa.attributes</parameter> is nonzero,
+any RDFa Lite attributes appearing on elements in the XML source will
+be copied through to the corresponding element in the generated HTML.
+If the parameter is zero, then those attributes are not copied though.
+The default value is "1".</para>
+
+</refsection>
+</refentry>