Discussion:
Newbie: SGML - dtd (xml / html)
(too old to reply)
Henry Law
2009-02-21 16:13:33 UTC
Permalink
Hi,
i wanted to dig into xml,
and i guess its no wonder,
that i ended up at SGML (so far).
May be someone can enlight me a little bit !?
So far i got html is an application of SGML.
I try not to respond to posts like this with "why don't you search the
web": it's unkind and unhelpful. So I started out to refine my own
knowledge, at least to the point where I could write an answer your
quite simple questions. But to do that I started with Wikipedia, and
really all I need to tell you is to go there for a start. It has short
definitions (and the English isn't too complex: I'm guessing you don't
speak it as a first language) and it has references to other material.
Do go there and do a bit of research, then come back here and post
questions and one of the real experts (not me!) will try to help you.

There's a mailing list too, but I strongly suggest you learn the basics
off the web before joining it.
--
Henry Law Manchester, England
Peter Flynn
2009-02-24 21:55:59 UTC
Permalink
Hi,
i wanted to dig into xml,
and i guess its no wonder,
that i ended up at SGML (so far).
May be someone can enlight me a little bit !?
So far i got html is an application of SGML.
Correct.
The mean thing i got out, "principically" html has to subject
the rules of the dtd ( that normally should be given )
Correct, if you want the HTML to be valid (because you want to use SGML
software).

BUT...

Web browsers don't bother with validation, and they accept anything
which uses the HTML element type names in pointy brackets, no matter how
non-conformant it is. So an estimated 99% of all HTML on the web is
invalid and will not work with a DTD.
as well as it is valid for xml
XML *must* be well-formed, *always*. Otherwise it will not work at all.
It *may* also be valid, according to some DTD or Schema, if the design
of the application requires that.
Am i right, that SGML is the "programming language" for dtd's ?
Yes, with some slight changes for XML (mostly all the extra options of
SGML cannot be used in XML).

The language used for DTDs is called "Declaration Syntax" and it is
different from the language used for SGML and XML documents, which is
called "Instance Syntax" or "Document Syntax".
The mean question >
that dtd's are build according to the desing rules, that are specified by
sgml
No, the design rules are specified by the human who designs the document
type.

SGML does not specify any design rules except that the document
structure is hierarchically organised (markup cannot overlap, so
everything must be wholly contained inside something else).

Otherwise, the document type designer is free to design the structure as
needed, from the simplest XML document:

<a/>

to the most complex (perhaps TEI or DocBook). The document type designer
then implements the structure in a DTD or Schema, so that programs which
construct or deconstruct the documents can read it and use it as a map
so that they know what is allowed and what is forbidden.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Peter Flynn
2009-02-26 00:31:30 UTC
Permalink
http://xml.coverpages.org//sgmlsyn/sgmlsyn.htm#C6
That's expressed in formal language. Not much use for learning, only for
reference.
"Where in gods name is the parser, that prooves against the SGML syntax
definition?"
For SGML I use onsgmls (part of the SP package).
I now think i understand --not easy to declare a imagination--, SGML is more
or less a theoretical concept.
Correct. It's a formal standard for a metalanguage.
Portioned into rules, which try to give formulas
for real world documents and parts of it.
Other way round. People try to express real-world documents using SGML
(now XML) syntax. It doesn't always work, but most of the time it's OK.
So far i get it out each special rule is called "production" (which may
include other productions as well--).
That is a formal term from Computer Science.
If SGML is a set of 204 "productions" (i refer here simply to the highest
number of the coverpages, given in the link)
does it mean, if XML is derived from SGML, that XML the has just a smaller
number of productions ?
Or some of the productions are anyhow shortened (with less included
productions) ?
XML is derived from SGML but the XML Specification re-expresses the
whole metalanguage in a much smaller number of productions. Basically a
decade of experience with SGML had revealed that the problem with
adoption was that SGML was simply too complex for most applications.
A production belongs to both or only to sgml. -or- A production is "full"
at sgml, shortened at xml.
No, SGML productions belog to SGML only; XML productions belong to XML only.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Continue reading on narkive:
Search results for 'Newbie: SGML - dtd (xml / html)' (Questions and Answers)
6
replies
computer related abbrevations?
started 2007-07-10 09:17:37 UTC
programming & design
Loading...