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

Re: Attributes with Intent (and namespaces)

  • From: james anderson <James.Anderson@m...>
  • To: "xml-dev@i..." <xml-dev@i...>
  • Date: Mon, 06 Jul 1998 12:32:25 +0200

elements of intent
let's take this a step further:

MURATA Makoto wrote:
> ...
> i wrote:
> > 6. to accomplish this, the application will depend on functions of the form
> >    (UniversalName) -> (Declaration + Behaviour)
> 
> I think we diverge here.  To implement this *function*, application programs
> have to know URI's specified in the namespace declaration.  In other words,
> developers of namespace-aware programs write:
> 
oops. i neglected an operator. please exclude the oversight. i was preoccupied
with 'behaviour' in the sense of validation - which is declared via schema and
thus adequately supported with the one operator. please allow me to extend '6'
as follows

6. to accomplish this, the application will depend on functions of the form
   (UniversalName x Behaviour) -> (UniversalName)
   and
   (UniversalName) -> (Declaration + Behaviour)

the application should not implement this mechanism. this is important. it is
an operation which is so basic as to be integral with the dom. it's on the
level with dereferencing a variable in c, or symbol-value and get in lisp. the
application should not have to write a single line of code to make these
functions work. (in order to do anything useful, the functions will be
'feature-qualified' - more like get than symbol-value, but that's a side point.)

the distinction you note below is a distinction in behaviour. read 'behaviour'
as 'function' or  'continuation'. the browser or search engine 'behaviour' is
a computation which is named implicitly by the respective symbol or (symbol X property)

> (XML Browser)
> 
>         "If I encounter an element of the MathML URI, I invoke techexplorer".
> 
> (Search Engine)
> 
>         "I search for the first element of the DublinCore URI, and then examine
>         the author and title described in its subordinate elements."
> 

i'll take the second example. please excuse my uncertainty wrt dublin core
encoding, but i find only examples which do not propose an element hierarchy
within the d-c space. in any case, i believe you will understand the point. if
i paraphrase an example from the rdf m&s wd (WD-rdf-syntax-19980216) as follows,

<?xml:namespace ns="-//purl.org/metadata/dublin_core//Schema Dublin Core//en"
prefix="DC"?> 
<?xml:namespace ns="-//www.w3.org/TR/WD-rdf-syntax//Schema RDF//en" prefix="RDF"?>

 <RDF:RDF>
  <RDF:Description RDF:HREF="http://www.bar.com/some.doc"
                   RDF:BAGID="Statement_001"> 
   <DC:Creator>John Smith</DC:Creator> 
   <DC:Title>A Book Which John Wrote</DC:Title> 
   </RDF:Description> 
  </RDF:RDF>

my application would do something like:

(defNamespaceRegion "-//purl.org/metadata/dublin_core//Schema Dublin Core//en"
  :nicknames (list "dc"))
(defNamespaceRegion "-//www.w3.org/TR/WD-rdf-syntax//Schema RDF//en"
  :nicknames (list "rdf"))

and then either

(defElementProcessor rdf:Description (element)
	(let-element-content (dc:Creator dc:Title) element
      (examine dc:Creator)
      (examine dc:Title)))

or 

(dolist (element
         (xptr.find-elements (make-xpointer "root().descendant(all,rdf:Description)")
                             *document*))
  (let-element-content (dc:Creator dc:Title) element
      (examine dc:Creator)
      (examine dc:Title))


none of which requires that the symbols be examined. it is not even required
that the application proper "know URI's specified in the namespace
declaration" for a region with which it is concerned. in a case in which the
application did not even know the exact name of the namespace region until the
document was decoded, but wanted to do something for identifiers from all
regions for which the URI matched a given pattern would be better handled by
one of the suggested dom constructions functions than by munging namespace
names within the application. for example
 8. ... (URI X UniversalName ) -> UniversalName
would enable the application to map symbols from a region of its choosing to
any region necessary. for example,

(defNamespaceRegion "rdf")
(defParameter *dc-pointer* (make-xpointer "root().descendant(all,rdf:Description)"))
(defParameter *my-rdf-names* '(rdf:Description))
(defMethod bind-namespace-region :after
	((prefix string) (region namespace-region) &aux (ns (namespace-region.uri region)))
  (when (search "Schema RDF" ns :test #'char-equal)
    (import-universal-names *my-rdf-names* region)))


> Just in case you think that namespace declaration describes behavior:
> A namespace declaration does not describe behavior.  (DTD's do not either,
> and probably schemas won't.)  It only provides a URI.  The rest is the task
> of application programmers.

please note the remark on behaviour above. while namespace regions do not
'describe' behaviour, they do avail the application of unique names to which
it can ascribe behaviour. inif the en/decoding layer constructs universal
names as 'first class objects' and the dom provides means to manipulate them,
the application writers are much better off.

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.