Automating Search Interfaces

David Megginson ak117 at
Wed Feb 18 01:02:06 GMT 1998

Peter Murray-Rust writes:

 > Posted on behalf of John Petit

 > >One solution may be to use DTD attributes to cue the search engines.
 > >Perhaps a "LEVEL" attribute could cue the searchers to display
 > >interfaces to predefined levels. The example below shows that the
 > >"LEVEL" attribute means that the "numbeds" element should always appear
 > >in a search query, or at the top level or searches. Any elements that
 > >did not have this level 1 attribute would not be shown in the search
 > >interface. If the "LEVEL" attribute was not found in the DTD, the
 > >default would show all of the elements with search fields next to them.
 > >
 > ><!ELEMENT numbeds (#PCDATA)>
 > ><!ATTLIST numbeds
 > >    SNAME CDATA #FIXED "Number of beds"
 > >    LEVEL CDATA #FIXED "1">

You could generalise this idea so that, instead of giving the level,
you gave the element type name in a different (real or hypothetical
DTD).  In other words,

  <!ELEMENT numbeds (#PCDATA)>
  <!ATTLIST numbeds
    general-doc NMTOKEN #FIXED "div1">

In other words, you're saying that the 'numbeds' element corresponds
to 'div1' (first-level division) in the other DTD.  This is more
useful, because you can express richer relationships than simply the
level.  For example, you could specify that 'expletive-deleted' is a
type of emphasised phrase and that 'city' is a type of name:

  <!ELEMENT expletive-deleted (#PCDATA)>
  <!ATTLIST expletive-deleted
    general-doc NMTOKEN #FIXED "emphasis">

  <!ELEMENT city (#PCDATA)>
  <!ATTLIST city
    general-doc NMTOKEN #FIXED "name">

That way, a user could search for any type of emphasised phrase or
proper noun, no matter what the element type was named. 

All the best,


David Megginson                 ak117 at
Microstar Software Ltd.         dmeggins at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list