Minna Gordon wrote:
> I have encountered some conflicting information about differences between
> xml and sgml dtds. I need to be set straight on the following as regards
> to xml:
> Is it true that pcdata must be in optional and repeatable or groups?
> ie, no <!ELEMENT perpetrator (PCDATA | scar)+>
You can have:
<!ELEMENT perpetrator (#PCDATA | scar)*>
which is functionally identical, due to #PCDATA representing zero or more data
> True there should be no grouping of elements into one declaration?
> ie, no <!ELEMENT (perpetrator | victim | innocentbystander) (%reaction)>
No, this is not allowed.
> What about grouping attribute lists together?
> ie: <!ATTLIST ( cat| dog | ferret) %common.atts; >
This isn't either.
> Cdata should not be used in an xml dtd?
No, CDATA can be used only in a CDATA marked section.
> I understand there should not be minimization or maximization fields in an
> xml dtd. If you omit these, is it still an sgml dtd? How can you use one
> dtd for both sgml and xml?
Change your SGML declaration so that OMITTAG is set to NO. There are a couple
of other changes that you might want to make to allow the modified delimiter
for an EMPTY element and to keep the case from folding to upper when it goes
though a processor, but they're pretty standard - I feed a fair bit of XML to
FrameMaker+SGML with good results.
> If you depart from xml rules, ie have an inclusion in your dtd, but the dtd
> and the data are xml compliant in every other way, is the data considered
> well formed xml, but not valid (dtd-less)?
Yes, that's fine. I've moved away from inclusions in SGML DTDs as well, not
that I used them often anyway.
Marcus Carr email: [log in to unmask]
Allette Systems (Australia) www: http://www.allette.com.au
"Everything should be made as simple as possible, but not simpler."