Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: develop
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (26 sloc) 0.749 kb
xquery version "1.0";
declare namespace db = 'http://docbook.org/ns/docbook';
document {
<html>
<body>
{
for $category at $cindex in //db:*[ @role='category' ]
let $ctitle := $category/db:info/db:title/text(),
$cabstract := $category/db:info/db:abstract/db:*
return
(
<h1>{concat($cindex,'. '), $ctitle}</h1>,
<p>{$cabstract}</p>,
for $pattern at $pindex in $category/db:*[ @role='pattern' ]
let $ptitle := $pattern/db:info/db:title/text(),
$abstract := $pattern/db:info/db:abstract/db:para
return
(
<h2>{string-join( ($cindex cast as xs:string,$pindex cast as xs:string),'.' ),'. ',$ptitle}</h2>,
<p>{$abstract}</p>
)
)
}
</body>
</html>
}
Jump to Line
Something went wrong with that request. Please try again.