Output HTML+RDFa 1.1 in XHTML5 #1

53 commits merged into from May 11, 2012


None yet

2 participants


This could use some improvement; I just hack my way through XSLT, but it seems to output proper RDFa 1.1. I get reasonable output when running it through my own distiller, for example. Try it at http://rdf.greggkellogg.net/distiller, or through the W3C pyRdfa distiller at http://www.w3.org/2012/pyRdfa.

hughbris and others added some commits Jul 1, 2010
@hughbris hughbris merge from upstream 16e7adc
@hughbris hughbris file html-dctype.xsl is properly tab-indented now b0e82fb
@hughbris hughbris Someting failed in the last local merge - restoring 5955a2a
@hughbris hughbris Post-confusion, this merge will hopefully work, so the last push was …
…regression :)
@hughbris hughbris Inserted tbody elements, which are going to need as wrappers to hang …
…RDFa attributes off;

Provided further semantic hooks into table cells, like @scope and @axis - required changing left cell containing property label into a <th>, which it is;
@hughbris hughbris Moved page <h1> up, which was positioned wrongly 0be58e6
@hughbris hughbris Not worth creating a template for simple boolean tests in XSLT 1.0 be…
…cause of string to boolean casting nonsense
@hughbris hughbris Added inline CSS to nail down CSS tweaks required after changing some…
… <td>s to <th>s; added extra classes to provide CSS selector context
@hughbris hughbris Some RDFa insertions made:
* added root <html/> namespace and version to indicate RDFa;
* added @scope to docinfo rows;
* property attribute is copied from header source XML (see below)
* <date>/headers/header-doc-dctype.xml augmented with @property where applicable (only way I can think of just now);
* @about added to each term's <tbody/> element;
@hughbris hughbris Ha! the webservice default param value works, but it seems this param…
…eter is never used!: removed and also from build.xml
@hughbris hughbris Changed html meta/@http-equiv to show utf8; added @encoding to xsl pr…
@hughbris hughbris Merge branches 'utf8' and 'timeService' 6ffdb7a
@hughbris hughbris fix line endings 6f5addf
@hughbris hughbris Some parameter fixes:
* changed the way section parameters are evaluated in xsl and build.xml
* changed parameter todayDate to todaysDate in build.xml
* defaulted todaysDate to use web service (though its only use is commented out)
@hughbris hughbris Incomplete cleanup (part 1):
* namespaces added
* indentation
* xsl:comment used instead of escaped XML comment delimiters for SSI calls
@hughbris hughbris Completed indentation clean 770c862
@hughbris hughbris Finishing obvious cleaning tasks:
* added default parm for print_header
* removed repetitious code, esp. in conditionals
@hughbris hughbris Reshuffling code with no significant effect on result:
* switched to matching templates from named templates (generally), very similar (the same for some) to what has been done for html-dctype.xsl
* moved intro.history.xsl to intro.history.xml and made it a valid XHTML document (with stub head)
* fixed invalid paragraphs in intro.history.x(s|m)l
* redid the path parameters for the top-level transform
* used document function to copy contents from intro.history.xml rather than implementing as an included template
* reduced duplicate sorting declarations when applying templates to <term/> by moving it down a level
@hughbris hughbris Removed some commented out debug output 0d05f84
@hughbris hughbris couple more commented out debug outputs deleted 029f573
@hughbris hughbris DC Types page updated with correct doctype for RDFa and correct encod…
…ing value after putting through W3C validator
@hughbris hughbris Some HTML document changes for HTML history:
* html/@version added for RDFa
* placeholder comment for possible feed autodiscovery link
* utf-8 in <meta/> content-type
* correct doctype declarations for RDFa
@hughbris hughbris Adding semantic HTML and RDFa mostly for HTML history:
* added @property to applicable elements in header-doc-history.xml
* added fragment identifier (@id) for introduction in intro.history.xml
* moved presentational attributes out of "legend" table and references table, some because validator complained
* slight change to common-ish code in both html-dctype.xsl and html-history.xsl to make property value output consistent with nearby invocations (<apply-templates/> rather than <xsl:value-of/>)
* added inline style required for tables in introduction to history page after presentation attributes removed (see above)
* comments added noting some probable code reuse opportunities
* added table semantics and RDFa attributes based on templates/patterns used in html-dctype.xsl
* significantly, changed @about value in template matching <term/> to "{Version}" from "{URI}" (used in html-dctype.xsl)
@hughbris hughbris set version and encoding for XML prolog in html-history.xsl and html-…
@hughbris hughbris added a mechanism for proof of concept to provide rdfa properties fro…
…m DCtype term attributes; output provides triples in check.rdfa.info
@hughbris hughbris top level resource properties ("docinfo") now use @rel rather than @p…
…roperty on link container, from feedback from check.rdfa.info; performed in html-dctype.xsl and duplicated in html-history.xsl
@hughbris hughbris canhaz tripels:
* completed term properties mapped to RDFa
* improved element names in property map (still resides in dctype.xml)
* added Name → dc:title mapping so it doesn't have to be hardcoded
* added template for <match/> (formerly <mapping/>) elements in the "map" key with mode="rel" to support HTML links
* added and moved invocations of <match/> templates within <term/> children (properties) to better match context
@hughbris hughbris @datatype implanted into XHTML:
* added to header-doc-dctype.xml for copying
* added to <mapping/>s in dctype.xml for copying
* expanded <term/> child templates to copy @datatype in html-dctype.xsl
* expanded <match/> template to copy @datatype in html-dctype.xsl
* added template for @property or @datatype (just copies them) in html-dctype.xsl
* added xmlns as required to html-dctype.xsl
@hughbris hughbris Added empty spans with @content to RDFa output to get some triples in…
… RDF version but not rendered in XHTML

* reordered <match/> elements within <map/> in dctype.xml to make completeness checking easier
* in html-dctype.xsl, added a template for some <term/> children with @mode="content"
* in html-dctype.xsl, invoke "content" mode within tbody/tr/th for the <term/>, in lieu of a good place
Tested successfully at check.rdfa.info.
@hughbris hughbris Added file web/xsl/html-common.xsl for common templates, included it …
…within html-dctype.xsl and exported. Outputs have no diff. html-history.xsl not yet touched
@hughbris hughbris Included html-common.xsl it within html-history.xsl and removed many …
…templates. Outputs before and after have no diff. (NB. Many recent RDFa developments not yet incorporated into html-history)
@hughbris hughbris Started adding RDFa to HTML history, with lots of changes to property…
… mapping architecture:

* added @datatype to header-doc-history.xml
* added mappings.xml file, which provides a default mapping and overriding matches for some "contexts"
* changed embedded mapping in dctype.xml to an XInclude of mappings.xml
* added XInclude of mappings.xml in dcterms-properties.xml (maybe not the best place, works)
* some cleanup in html-common.xsl
* added template for <match/> in "rel" mode to html-common.xsl
* adjusted xsl:key in html-dctype.xsl to filter for map @context
* added namespaces, xsl:include to html-common.xsl, and xsl:key for mappings to html-history.xsl
* added <span/> pattern for Term Names in html-history.xsl as per html-dctype.xsl
* added RDFa attributes pattern to "fragment display" template in html-history.xsl as per html-dctype.xsl
NB. solution for RDFa in HTML history not fully implemented and very likely to change.
@hughbris hughbris Completed RDFa required for DC HTML history file:
* inserted XInclude of mappings.xml file into dcam.xml, decelements.xml, dcterms-classes.xml, dcterms-ses.xml, dcterms-ves.xml
* cleaned dctype.xml a little
* amended mappings in mappings.xml:
** no more legacy dc namespace
** new mappings
** some changes from finding Tom's mappings comment in common-templates.xsl
* added skos xmlns, removed legacy "dc"
NB mappings themselves need review by a DC/RDFS semantics expert
@hughbris hughbris Small build cleanup:
* removed parameter "tt" from html-dctype.xsl and build.xml as it seems not to be in use
* added cautionary comments to build.xml about requiring XInclude support
@hughbris hughbris Moved identical content of two templates from html-dctype.xsl and htm…
…l-history.xsl into html-common.xsl as fragmentCheckingRow and called it from previous locations
@hughbris hughbris Moved some <match/> elements from history context to default context …
…in mappings.xml since they are not in both places. No diff to before/after output
@hughbris hughbris Cleanup to start work on html-dcmiterms.xsl: fixed indentation, remov…
…ed redundant parameters in build.xml
@hughbris hughbris html-dcmiterms.xsl: gets by with very few parameters now, as I did fo…
…r html-history.xsl
@hughbris hughbris headers/intro.dcmi-terms.xsl becomes headers/intro.dcmi-terms.xml so …
…that we can copy its content from html-dcmiterms.xsl like we did intro.history.xml from html-history.xsl. We've now lost the clean diff comparing with the original output.
@hughbris hughbris cleaned indentation in headers/intro.dcmi-terms.xml and made invalid …
…paragraphs valid
@hughbris hughbris In html-dcmiterms.xsl, added RDFa doctype and @version for output, al…
…so utf-8 and XML version 1.0
@hughbris hughbris * added changes to html-dcmiterms.xsl up to and including document in…
…formation from the header file

* unhardcoded H1 text, also from html-dctype.xsl
* added RDFa attributes to header-doc-dcterms.xml
* updated all header-doc-* files, removing legacy "dc:" namespace
@hughbris hughbris * continued to clean up html-dcmiterms.xsl up to the index of terms
* added section headings as HTML within XML data files
* added "toc" mode for outputting table of contents from headings in files
* changed intro section ("section 1") identifier from a/@name to wrapping div with @id
* inline CSS additions as required
@hughbris hughbris * continued cleaning html-dcmiterms.xsl up to detailed section data
* added parameter test.hostname so I can pass it "http://dublincore.org" and preview with its stylesheet
* fixed inline CSS to what it should have been at last commit
* renamed "toc" mode to "heading" mode to reflect more generic use
* added new templates in "index" mode to allow Index of Terms to be generated from data with less XSL repetition
@hughbris hughbris Main terms (table) sections rewritten for same output with less XSLT …
…in html-dcmiterms.xsl
@hughbris hughbris * completed bringing <term/> elements in html-dcmiterms.xsl main cont…
…ent sections into framework established in previous transforms

** added namespaces required for RDFa attributes incorporated as part of above change
** added required key for mappings lookup
** copied and adapted templates mostly from html-dctype.xsl - can probably single-source these as they often use same match conditions
* corrected omitted dc:description in legacy namespace in mappings.xml
* removed <match/> in "rel" mode from html-dctype.xsl which I noticed is in html-common.xsl
@hughbris hughbris Improved HTML markup in intro.dcmi-terms.xml:
* removed linebreaks in paragraphs and also double spaces between sentences
* used table classes for styling (validator complains)
* added PoSH attributes to table elements
* changed a/@name to @id on wrapping element, adding some <div/>s when needed
* added hopefully useful fragments with @ids
* changed References heading to <h3/> (hope that's OK?)
* added @type to non-HTML links in References section
* (added @id="introduction" in intro.history.xml as per intro.dcmi-terms.xml)
@hughbris hughbris Finished cleaning output of html-dcmiterms.xsl:
* added forgotten @datatype to headers/header-doc-dcterms.xml
* some embedded styles added
* @id added to table of contents
* plain old head/link added to point to t.o.c. in lieu of RDFa @property being satisfactory (refer comments)
* a/@name substituted for @ids
* added PoSH to more tables
@hughbris hughbris fixed mistake where I used @content on html <link/> (rel=dcterms:tabl…
…eOfContents), changed to @href and added @title
@hughbris hughbris * moved "regular" templates to own new library file html-regular.xsl
* included html-regular.xsl from html-dctype.xsl and html-dcmiterms.xsl
* uncovered effectively inconsistent <Status/> element handling between html-dctype.xsl and html-dcmiterms.xsl, explained in comment in html-regular.xsl
* added $test.hostname param to html-dctype.xsl and html-history.xsl
@hughbris hughbris * defaulted $ns parameter in html-dctype.xsl
* added $todaysDate and $datestamp.dir as per other html transforms
* reflected parameter changes in build.xml
* cleaned indentation in some header files
@gkellogg gkellogg RDFa 1.1 updates. Uses XHTML5 elements. Could use a better mapping ta…
…ble, but seems to output proper RDFa.
@gkellogg gkellogg Merge remote-tracking branch 'origin/master' into gkellogg-master
@ghost ghost merged commit 37a8770 into dcmi:master May 11, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment