Skip to content

Instantly share code, notes, and snippets.

@liudong
Created October 16, 2012 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liudong/3897581 to your computer and use it in GitHub Desktop.
Save liudong/3897581 to your computer and use it in GitHub Desktop.
XSLT: Basic template
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!ENTITY foaf "http://xmlns.com/foaf/0.1/">
<!ENTITY dcterms "http://purl.org/dc/terms/">
<!ENTITY dc "http://purl.org/dc/elements/1.1/">
<!ENTITY mo "http://purl.org/ontology/mo/">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:rdf="&rdf;"
xmlns:foaf="&foaf;"
xmlns:dc="&dc;"
xmlns:dcterms="&dcterms;"
xmlns:mo="&mo;">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<xsl:apply-templates select="//"/>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment