Created
July 1, 2010 18:23
-
-
Save anonymous/460341 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare default element namespace "http://www.w3.org/1999/xhtml"; | |
let $xslt := | |
<xsl:stylesheet version="2.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xpath-default-namespace="http://www.w3.org/1999/xhtml"> | |
<xsl:template match="title"> | |
<h1> | |
<xsl:apply-templates/> | |
</h1> | |
</xsl:template> | |
<xsl:template match="para"> | |
<p> | |
<xsl:apply-templates/> | |
</p> | |
</xsl:template> | |
<xsl:template match="sectionTitle"> | |
<h2> | |
<xsl:apply-templates/> | |
</h2> | |
</xsl:template> | |
<xsl:template match="numbered"> | |
<ol> | |
<xsl:apply-templates/> | |
</ol> | |
</xsl:template> | |
<xsl:template match="number"> | |
<li> | |
<xsl:apply-templates/> | |
</li> | |
</xsl:template> | |
</xsl:stylesheet> | |
let $x := | |
<a> | |
<title>This is a Title</title> | |
<para>Some words are here.</para> | |
<sectionTitle>A Section</sectionTitle> | |
<para>This is a numbered list.</para> | |
<numbered> | |
<number>Install MarkLogic Server.</number> | |
<number>Load content.</number> | |
<number>Run very big and fast XQuery.</number> | |
</numbered> | |
</a> | |
return | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head><title>MarkLogic Sample Code</title></head> | |
<body>{xdmp:xslt-eval($xslt, $x)}</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment