OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: [relax-ng] Stylesheet for a:documentation

I have written a simple XSLT stylesheet for pulling <a:documentation>
content from RELAX NG schemas. You can change the content of <title> and
<h1> in the XHTML result tree by passing in a parameter value. I would
appreciate any comments you have.


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:param name="title">Documentation</xsl:param>

 <xsl:template match="/">
  <title><xsl:value-of select="$title"/>
   h1,h2 {font-family:sans-serif}
   p {font-family:serif;font-size:12pt;margin-left:20px}
  <h1><xsl:value-of select="$title"/></h1>

 <xsl:template match="value | param">

 <xsl:template match="a:documentation">
   <xsl:when test="parent::node()[not(name()='element')]">
    <h2>Node: <xsl:value-of select="name(preceding-sibling::node())"/></h2>
    <h2>Element: <xsl:value-of select="parent::node()/attribute::name"/></h2>
  <p><xsl:value-of select="."/></p>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC