[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Controlling link destination DOCTYPE

  • From: "W. Eliot Kimber" <eliot@i...>
  • To: <xml-dev@i...>
  • Date: Mon, 06 Apr 1998 15:31:55 -0700

controlling link attributes html
At 12:54 PM 4/6/98 -0700, John Tigue wrote:
>     Is there any way (XML, HyTime, etc.) to declare that an ENTITY
>     attribute is not only an ENTITY attribute but that the value
>     must be of a particular declared NOTATION? That is, the
>     entity must be declared to have a particular NDATA? Or is this
>     simply application level constraints not parser level?

HyTime provides a partial solution: reference type control. Very simply,
you can associate referential attributes (e.g., an ENTITY attribute) with a
list of element types that an attribute can address. You use the "reftype"
attribute, like so:

<!ATTLIST linkToABarDoc
          docLinkingTo ENTITY #REQUIRED
            #FIXED "docLinkingTo myBarDoc"
            #FIXED "clink"
            #FIXED "linkend docLinkingTo"

This simply says "the element addressed by the docLinkingTo attribute must
be a myBarDoc element". Note that, by HyTime (and XPointer) rules, a
reference to a document is shorthand for a reference to its root element.
[the HyTime and HyNames attributes are there to complete the architectural
mapping from the element to the clink element type defined by the HyTime
architecture--they enable a HyTime-aware processor to recognize that the
reftype attribute is the one defined by HyTime.]

However, this doesn't really solve John's problem, which is to constrain
the reference to documents that use a particular set of element type
declarations, not the element type of the document element (which could
vary depending unless the declarations declare exactly one element type). 

There is no HyTime facility for doing this (although perhaps there should be).

However, you could define your own application convention for doing it:

<!ATTLIST linkToABarDoc
          docLinkingTo ENTITY #REQUIRED
            #FIXED "docLinkingTo 'The BarDecls PUBLIC ID'"

Where "doctype-constraint" is like reftype except that the second parameter
is the public ID of the external DTD subset of the document referenced by
the docLinkingTo attribute, not the element type.

Of course, the external declaration subset is not reliable as no document
need have one (even if it uses the same declarations explicitly by copying
them into the internal subset or using a normal external parameter entity).
What you really need is an "architecture use constraint" that requires that
the referenced document be derived from a specific SGML architecture:

<!ATTLIST linkToABarDoc
          docLinkingTo ENTITY #REQUIRED
            #FIXED "docLinkingTo 'The BarDecls Architecture PUBLIC ID'"

In both cases, the constraint checking can be easily implemented using any
processor with access to the DOCTYPE properties or architecture use
declaration (either in PI form, as would be used for XML documents, or
notation declaration form, as can be used with SGML documents).  Even if
not implemented, it conveys the author's intent about the constraints on
the reference.

In neither case would the parser enforce these constraints--these are
processor-specific semantic constraints, not parse-time constraints (in
other words, you parse the document and then process it to resolve links
and addresses, at which time you would check and enforce these constraints.


<Address HyTime=bibloc>
W. Eliot Kimber, Senior Consulting SGML Engineer
Highland Consulting, a division of ISOGEN International Corp.
2200 N. Lamar St., Suite 230, Dallas, TX 95202.  214.953.0004

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


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.