This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re: Which Variant of DocBook (SGML or XML)?


/ Karl Eichwalder <keichwa@gmx.net> was heard to say:
| Norman Walsh <ndw@nwalsh.com> writes:
| 
| > To the greatest extent possible, there are no differences between the
| > two versions. With an eye to the future, if you have no SGML legacy,
| > you should use the XML version.
| 
| With the XML version you're not able to detect "errors" like
| 
|   <para><footnote>
|     <para>
|      <footnote><para></para></footnote>
|     </para>
|    </footnote>
|   </para>
| 
| XML lacks inclusion/exlusion exceptions.

Right. The lack of inclusions and exclusions and INCLUDE/IGNORE marked
sections in a document are examples of things beyond "the greatest
extent possible". But I stand by my assertion, if you don't have SGML
legacy, XML is the future.

| Once available, a SCHEME based
| validation process might help.  Maybe, a DTD based validation isn't
| strong enough for your purposes; in this case you'll have to wait for
| a schema implementation.

It would be fairly easy to write a validator to check for things like
nested footnotes, if you're concerned that your authors might do that.
This XSL stylesheet will do the trick, in fact:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'>

<xsl:output method="text"/>

<xsl:template match="text()">
  <!-- suppress -->
</xsl:template>

<xsl:template match="*">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="footnote//footnote">
  <xsl:message>Warning: document contains nested footnotes.</xsl:message>
</xsl:template>

</xsl:stylesheet>

| > Note that you can process the XML version with either XSL or DSSSL
| > (because XML is SGML).  (And you could, in theory, process the SGML
| > version with XSL too, if someone would write an SGML-based XSLT
| > processor.
| 
| Isn't it enough to run `sgmlnorm' and `sx' on any SGML document?  I'm

Yes, it's usually sufficient to run sgmlnorm and sx, I was merely
pointing out that there's nothing about XSLT that requires the input
byte-stream to be an XML document. XSLT is a tree-to-tree
transformation process.

| not aware of an XSLT processor which requires an XML schema.

I don't follow. I was talking about SGML, not XML Schemas.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com>      | The function of the imagination is
http://www.oasis-open.org/docbook/ | not to make strange things
Chair, DocBook Technical Committee | settled, so much as it is to make
                                   | settled things strange.--G. K.
                                   | Chesterton

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]