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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: DOCBOOK: Re: sgml vs xml


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

/ Ben Hratshorne <docbook@green.hartshorne.net> was heard to say:
| On Fri, Mar 07, 2003 at 04:32:30PM +0100, Stephane Bortzmeyer wrote:
[...]
|> You can (I do) use DSSSL for XML documents. The choice of a markup
|> meta-language is partly independant of the choice of the stylesheet language.
|
| I was confused by this.  Though I understood the difference between
| SGML/XML and DSSSL/XSL (you're right it was a typo), I thought that if
| you use SGML, you must use DSSSL, and if you use XML, you must use XSL.

Nope. XML is a subset of SGML. So SGML tools will accept XML input
with a little work. (As long as you avoid using namespaces, or use
them with some control over the prefixes used.)

| I was unaware you could use DSSSL with XML.  Is the converse true - can
| you use XSL with SGML?

There's no technical reason why you couldn't. XSL is a tree-to-tree
transformation language and SGML documents are certainly trees. But I
don't know of any XSLT processor that has a general-purpose SGML
parser on the front end. I think xsltproc has some heuristics for
accepting (some?) DocBook SGML documents.

| I also could not find a good description of equivelancies between XML
| and SGML in terms of how to crunch documents, how to use entities, and
| so on.  I learned by looking at examples from the linux documentation
| project.  

XML is SGML without the features that were hard to implement or required
DTD processing to handle: tag omission, short ref, short tag, etc.

| For example, I know that the first line (where you cite the DTD to which
| you are conforming) is different for XML vs. SGML, but that is about the
| extent of the documentation I could find for the difference.  

Uhm, the <!DOCTYPE line is basically the same except that a SYSTEM
identifier is required for XML and optional for SGML.

| But...  at this point I have one (mostly) complete manual in SGML.  Any
| tips on what I might need to change to switch it over, besides the first
| line?  I think the only tricky part is that I have a couple of
| conditionally compiled sections:
|
| <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
|
| <!-- change INCLUDE below to IGNORE and none of the sections marked
|   %internal / versoin2 will be included when you compile the document.
| -->
| <!entity % internal "INCLUDE">
| <!entity % version2 "IGNORE">
|
| ]>
|
| <book>
|  ...
|  ...
| <![%version2; [
|   <section id="installtunnel">
|   ...
|   ...
| ]>

Yeah, the marked sections are going to be the hardest thing to
convert. You'll have to switch to profiling of some sort. See the
effectivity attributes and Jirka's excellent work on the profiling
stylesheets.

Basically, you'll have to change your example to:

 <book>
  ...
  ...
 <section id="installtunnel" condition="version2">
   ...
   ...
 </section>

| I have also made a few changes to
| /usr/share/sgml/docbook/utils-0.6.12/docbook-utils.dsl.  I didn't want
| to figure out how to create a proper customization layer so I just
| changed that one. 

Ack! You'll regret that when the next DSSSL release comes out. (Any
day now.)

| Will those have to be completely redone in XSL?  Though I conceptually
| understand the XML/XSL/DSSSL thing now, I'm still fuzzy on
| implementation details.

Yes, you'll have to redo them.

                                        Be seeing you,
                                          norm

- -- 
Norman Walsh <ndw@nwalsh.com>      | Resist the urge to hurry; it will
http://www.oasis-open.org/docbook/ | only slow you down--Bruce Eckel
Chair, DocBook Technical Committee |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>

iD8DBQE+byr6OyltUcwYWjsRAkEtAJ0QHDkYrgLnY138OIvc/gxARe/BswCfdsDO
HN+Lkx4S4e/TfV39Ni1BWVM=
=UqNC
-----END PGP SIGNATURE-----




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