Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Advice on schema design: Mixing XHTML and a custom vocabulary.

Reply
Thread Tools

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

 
 
Peter C. Chapin
Guest
Posts: n/a
 
      01-17-2006
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
 
Reply With Quote
 
 
 
 
Henry S. Thompson
Guest
Posts: n/a
 
      01-17-2006
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>Tonight <planet>Jupiter</planet> was well placed for
> observing</xhtml>.


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: http://www.velocityreviews.com/forums/(E-Mail Removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
Reply With Quote
 
 
 
 
Peter C. Chapin
Guest
Posts: n/a
 
      01-18-2006
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>Tonight <planet>Jupiter</planet> was well placed for
>>observing</xhtml>.

>
>
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XHTML Modularization: Creating XML schema for mixed custom tags andXHTML mk189@seznam.cz XML 0 05-09-2008 12:14 PM
Should I Convert Site To XHTML or XHTML mobile? chronos3d HTML 9 12-05-2006 04:46 PM
parse URL (href) from xhtml, xhtml -> text, for data hawat.thufir@gmail.com XML 7 02-08-2006 07:39 PM
Mixing custom __setattr__ method and properties in new style classes L.C. Rees Python 3 02-08-2006 05:35 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM



Advertisments