XML Architecture Question (Best Practices?)

S

shrike

Howdy,

I have been studying XML and believe the following to summarize the
relationship between XML and XML Schemas. Please correct/extend these
assumptions if I am off-base.

############

1. XML is a syntactical standard for a tagging language.

2. XML Schemas are a tagging standard for insuring compliance of a
given XML tag-set to a user-defined tag-set.

3. In general, an API loads a schema for comparison against an XML
document.

############

So Schema writing is about defining compliance rules. Some documents
may be best-effort while others will require stricter conformance.
That pretty much size it up?

So what is the most standards-compliant Schema language at the
moment?

-Thanks in advance!
-Psy
 
G

Guest

2. XML Schemas are a tagging standard for insuring compliance of a
given XML tag-set to a user-defined tag-set.

Not quite. Validation checks compliance of a given XML instance
document (data file) to the schema it's being validated against. You
can think of schemas as defining "higher-order syntax constraints" --
they say what tagged elements, and what kind of data content, can
appear where. They have very limited ability to apply _semantic_
constraints, so your application will almost always still need to
check the document, but validation provides an initial check and
annotation pass, and the schema serves as a basic machine-readable
published specification of what constitutes a document of this type.

Part of your problem is that the term "xml schemas" is used to refer
to both the W3C's own XML Schema language -- which is in some sense
the "most official" solution -- and to other languages which serve the
same purpose (such as Relax and Schematron). And technically, even the
old XML Document Type Description (DTD) is a schema language, though
since it is almost completely incompatable with XML Namespaces it's of
steadily decreasing usefulness.

If you're looking for wide support, DTDs are supported everywhere...
but, as I say, they're on the verge of becoming obsolete. XML Schema
is supported almost everywhere at this point, and should probably be
high on your list of things to learn if you're serious about working
with XML.

The others... Sigh. XML Schema *is* verbose, and has a design that
makes a bit more sense to database programmers than to folks who've
worked with other kinds of data structures. And it has some
limitations. The other schema languages do some things XML Schema
can't and/or express some things more clearly (which is why their
authors created them) -- but they don't have a lot of traction, and
frankly I think their best value right now is in pushing the W3C to
improve future versions of XML Schema by demonstrating interesting
alternatives. If you're working in a closed environment, where your
documents aren't going to be validated by anyone but your own
applications, it may be worth investigating these... but they're of
minimal real-world utility otherwise, and I'll be somewhat surprised
if that changes. (Not necessarily displeased, just surprised.)
3. In general, an API loads a schema for comparison against an XML
document.

In specific: A validating XML parser loads a schema (or DTD) and uses
it to confirm that the incoming XML document(s) conform to that
schema. Whether the schema is preloaded and enforced against incoming
documents, or whether each document specifies which schema it wants to
be validated against, depends on the environment you're working in and
which tools you're using.

For more detail, see tutorials at sites like http://www.ibm.com/xml
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top