Skip to content

Instantly share code, notes, and snippets.

@ruthtillman
Created July 29, 2015 14:21
Show Gist options
  • Select an option

  • Save ruthtillman/97aa5d18dd12c7d9b61e to your computer and use it in GitHub Desktop.

Select an option

Save ruthtillman/97aa5d18dd12c7d9b61e to your computer and use it in GitHub Desktop.
<xsl:choose>
<xsl:when test="self::dc:date and text()[matches(.,'^\d{4}\-\d{2}-\d{2}')]">
<xsl:text>^^xsd:date</xsl:text>
</xsl:when>
<xsl:when test="self::dc:date and text()[matches(.,'^\d{4}\-\d{2}')]">
<xsl:text>^^xsd:gYearMonth</xsl:text>
</xsl:when>
<xsl:when test="self::dc:date and text()[matches(.,'^\d{4}')]">
<xsl:text>^^xsd:gYear</xsl:text>
</xsl:when>
</xsl:choose>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment