Advice on schema design: Mixing XHTML and a custom vocabulary.

P

Peter C. Chapin

Hello!

I'm in the process of creating a schema for marking up my personal
astronomical observations (yes, I know this has already been done; I'm
not worried about that... this is a pet project). What I would like to
do is introduce an <entry> element to enclose a log entry. I would like
to include, as possible children of <entry> certain elements of my own
design and yet also allow arbitrary XHTML text to appear, perhaps in
constrained locations, for the purpose of making free form notes while
having access to the full expressiveness of XHTML. The goal is to create
an observing log that is largely just free text but to have the
astronomically significant entities marked up clearly so they could be
easily extracted by suitable indexing programs, etc, etc.

Right now my <entry> element is described by the following complexType
(abbreviated here to avoid clutter):

<xs:complexType name="entryType">
<xs:sequence>
<xs:choice minOccurs="1">
<xs:element name="datetime" type="absoluteDateTimeType"/>
<xs:element name="localdatetime" type="localDateTimeType"/>
</xs:choice>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:choice>
<xs:any namespace="http://www.w3.org/1999/xhtml"
processContents="lax"/>
<xs:element name="observation" type="observationType"/>
</xs:choice>
</xs:sequence>
</xs:sequence>
</xs:complexType>

This appears to provide largely the effect I'm after but I'm nervous
about letting the XHTML elements just roam around in such an
unconstrained way inside an <entry>. Would it be better style to enclose
them in, say, a <text> element that would be a sibling to <observation>?
Or is there a generally more acceptable way to handle this problem overall?

I'd also like to be able to include custom in-line markup inside the
XHTML text. So for example:

<xhtml:p>Tonight <planet>Jupiter</planet> was well placed for
observing</xhtml:p>.

Do I need to do:

<xhtml:p>Tonight <xhtml:span class="planet">Jupiter</xhtml:span> was
well placed for observing</xhtml:p>.

Ideally I would like to arrange things so I can formally validate as
much of my instance documents as feasible. I understand there are limits
to what can be accomplished in this regard when mixing vocabularies like
this. Or perhaps I understand wrong?

Thanks for any advice you can offer.

Peter
 
H

Henry S. Thompson

Peter said:
...
This appears to provide largely the effect I'm after but I'm nervous
about letting the XHTML elements just roam around in such an
unconstrained way inside an <entry>.

Looks OK to me.
I'd also like to be able to include custom in-line markup inside the
XHTML text. So for example:

<xhtml:p>Tonight <planet>Jupiter</planet> was well placed for
observing</xhtml:p>.

See Modular XHTML [1]. For an example (using DTDs, not W3C XML
Schema, but that doesn't affect the design), see RDDL [2].

ht

[1] http://www.w3.org/TR/xhtml-modularization
[2] http://www.rddl.org/
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
P

Peter C. Chapin

Henry said:
Looks OK to me.

Okay, thanks. It's good to know that I'm not too far off base at least!
I'd also like to be able to include custom in-line markup inside the
XHTML text. So for example:

<xhtml:p>Tonight <planet>Jupiter</planet> was well placed for
observing</xhtml:p>.


See Modular XHTML [1]. For an example (using DTDs, not W3C XML
Schema, but that doesn't affect the design), see RDDL [2].

Modular XHTML... okay, I see where that's probably going to lead. It
sounds promising.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top