daytoc2rdf.xslt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. http://www.w3.org/TR/xslt/
  4. -->
  5. <xsl:stylesheet
  6. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  7. xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  8. xmlns:dctype="http://purl.org/dc/dcmitype/"
  9. xmlns:dc="http://purl.org/dc/terms/"
  10. xmlns:foaf="http://xmlns.com/foaf/0.1/"
  11. xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  12. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  13. xmlns:xlink="http://www.w3.org/1999/xlink"
  14. xmlns:iso639-1="http://lexvo.org/id/iso639-1/"
  15. version="1.0">
  16. <xsl:output method="xml" indent="yes"/>
  17. <xsl:param name="day"></xsl:param>
  18. <xsl:param name="language"></xsl:param>
  19. <xsl:template match="/">
  20. <rdf:RDF xml:base="http://www.europarl.europa.eu/" xml:lang="{$language}">
  21. <xsl:for-each select=".//a[not(@class) and contains(@href,'getDoc.do?pubRef=-//EP//TEXT')]">
  22. <!-- xsl:comment> zzz </xsl:comment -->
  23. <rdf:Description rdf:about="{@href}">
  24. <dc:title><xsl:value-of select="normalize-space(.)"/></dc:title>
  25. <dc:language rdf:resource="http://lexvo.org/id/iso639-1/{$language}"/>
  26. <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">
  27. <xsl:value-of select="substring($day, 1, 4)"/>-<xsl:value-of select="substring($day, 5, 2)"/>-<xsl:value-of select="substring($day, 7, 2)"/>
  28. </dc:date>
  29. </rdf:Description>
  30. </xsl:for-each>
  31. </rdf:RDF>
  32. </xsl:template>
  33. </xsl:stylesheet>