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

Discussion in 'XML' started by Peter C. Chapin, Jan 17, 2006.

  1. 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
     
    Peter C. Chapin, Jan 17, 2006
    #1
    1. Advertising

  2. Peter C. Chapin writes:

    > ...
    > 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:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
     
    Henry S. Thompson, Jan 17, 2006
    #2
    1. Advertising

  3. Henry S. Thompson wrote:

    >>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.


    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
     
    Peter C. Chapin, Jan 18, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,622
    Markus
    Nov 23, 2005
  2. Yash Sharma

    XML Vocabulary for PostScript

    Yash Sharma, Jan 1, 2004, in forum: XML
    Replies:
    4
    Views:
    436
    Jeroen Dekker
    Jan 4, 2004
  3. Oleg Paraschenko

    TeXML, the XML vocabulary for TeX

    Oleg Paraschenko, Apr 12, 2004, in forum: XML
    Replies:
    0
    Views:
    442
    Oleg Paraschenko
    Apr 12, 2004
  4. Replies:
    0
    Views:
    329
  5. thunk
    Replies:
    0
    Views:
    141
    thunk
    Mar 21, 2010
Loading...

Share This Page