Attributes with Intent

David Megginson ak117 at
Mon May 4 14:35:31 BST 1998

Peter Murray-Rust writes:

 > It's reasonable to assume that generic text-aware XML software
 > might be asked "please find all elements in a document which are
 > expressed in German." It can't look for all elements with
 > xml:lang="de" because they don't have this explicitly. So general
 > mechanisms such as XPointers can't be used, and bespoke software
 > must be written. This software (presumably) finds all elements
 > which *do* have the attribute and continues recursively.

>From a logical perspective, your query is simply

  Find all elements in a document where the element or the nearest
  ancestor with a value for the xml:lang attribute specifies "de" as
  the attribute's value.

With SDQL, for example, this test is surprisingly simple:

  (equal? (inherited-attribute-string "xml:lang") "de")

Your point is well-taken, though: fragments of XML documents are often
tightly bound to their context (similar situations would involve
attributes for effectivity, security level, revision status, etc.).

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