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: RE: [relax-ng] Annotations in the non-XML syntax

I think Javadoc encourages coders to document their code better because it
is easy to make pretty HTML documentation.

We could do something similar by offering (at least informally) some
pretty-print stylesheets for pulling a:documentation, DocBook, or XHTML
annotations from RELAX NG schema.

The attached stylesheet is a meager beginning (revised from my last post on
this). I am happy to spend some more time on this, but I need critical


-----Original Message-----
From: James Clark [mailto:jjc@jclark.com]
Sent: Wednesday, March 20, 2002 5:13 AM
To: John Cowan; Michael Fitzgerald
Subject: Re: [relax-ng] Annotations in the non-XML syntax

> I'd rather map the # comments into <!-- ... --> comments

I will try and do this, though it's not altogether straightforward. However,
I feel a little bit uneasy in that it will tend to encourage people to put
documentation in comments rather than annotations.  I would like to find
some way for the non-XML syntax to make it as easy to put documentation in
annotations as in comments.


<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">
  <p>Param value: <xsl:apply-templates/></p>

 <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