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>Tonight <planet>Jupiter</planet> was well placed for
observing</xhtml>.
Do I need to do:
<xhtml>Tonight <xhtml:span class="planet">Jupiter</xhtml:span> was
well placed for observing</xhtml>.
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
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>Tonight <planet>Jupiter</planet> was well placed for
observing</xhtml>.
Do I need to do:
<xhtml>Tonight <xhtml:span class="planet">Jupiter</xhtml:span> was
well placed for observing</xhtml>.
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