Embedding Content as Element Content or As An Attribute Value

Tyler Baker tyler at infinet.com
Thu Jan 8 21:50:29 GMT 1998



Chris wrote:

> Also, it seems that using an <Author> tag without a VALUe attribute
> makes sense if Mr. Baker isn't converting back and forth to objects at
> all, but is just doing something simple with authors - which I have a
> sneaking suspicion is all he's trying to do.
>

Actually, for now I am testing two DTD's.  One is just a simple container for user
info namely

NickName
FirstName
LastName
Email
PostMail
Phone
HomePage

The other is a DTD for storing the host name and port number of a currently running
server (if the CORBA IOR is not available), in addition to a CORBA IOR which points
to the actual live server (which for now is based on CORBA).  It also has the host
name and port number for where the actual COSS Event Channel lives for the app as
well as its IOR too.  Several different transport layers may be used in the future
(e.g. Voyager, RMI, DCOM, Sockets) so I plan on having a different DTD for each
transport layer.

Anyways, I will be using this second DTD in a manner which is similiar to CDF,
where I may have a repository of these XML files which point to these live
applications.  The repository more than likely will be run on a web server.

After getting used to the syntax of XML for defining a DTD, I am a little perplexed
about an element declaration of the form:

<!ELEMENT Foo (bar1 | bar2 | bar3)*>

vs.

<!ELEMENT Foo (bar1, bar2, bar3)*>

Apparently in the first example element Foo can have 0 or more bar1, bar2, or bar3
attributes but only one of these, excluding the other, and the second example
element says that you have 0 or more sequences of bar1, bar2, and bar3 attributes.
My confusion is that in the DTD's I have seen so far, the first example element is
used as if attributes bar1, bar2, and bar3 can all exist together or else as a
combination of two, or else singularly.  But in EBNF notation the ' | ' as far as I
know means one or the other and not both.

<!ELEMENT Foo (bar1?, bar2?, bar3?)>

Last but not least this example element seems to mean the same thing as the second
example element.

I am sorry to be posting this "please help me" post to an xml-dev list (which I
assume is mostly for parser writing discussion), but I have tried in the short time
I have been on this list I have tried to post pointers to parser writers that help
them in their quest for optimal importance so I don't feel too guilty (-:

Any info on this would be greatly appreciated as I cannot find any FAQ which
explains this in detail other than the current XML spec which IMHO has a lot of
ambiguities that are not clearly explained and therefore relatively confusing to
anyone who does not have extensive experience in the SGML camp.

Thanx in advance,

Tyler


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list