Re: XML Architecture Question (Best Practices?)



On Dec 19, 11:38 am, "shr...@xxxxxxxxxxxxxx" <shr...@xxxxxxxxxxxxxx>
wrote:
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



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

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

.



Relevant Pages

  • Re: Interplatform (interprocess, interlanguage) communication
    ... ability of using XML to represent free-form data, ... but one can wonder what is the gain of using a schema if one is just going to use "xsd:any"?... ... well, there are some rules, but the question is more if a schema or the use of validation would offer much advantage to make using it worth the bother?... ... I think the original point though was more about XML vs S-Expressions in this case though: ...
    (comp.lang.java.programmer)
  • Re: XmlValidatingReader - just the FAQS?
    ... > read an xml file and an xsd file and validate the xml file using ... The XML schema is fine, and your instance document is valid by it, ... > Validation Error: The 'Name' element is not declared. ... The XmlSchema constructor should only appear in applications ...
    (microsoft.public.dotnet.xml)
  • Re: validating if a file is a true valid xml file that fits a cert
    ... ''' Validates an XML stream against the specified XML Schema. ... ValidateXmlFileException if the XML stream or XML Schema fails validation. ... Public Sub ValidateXmlFile(ByVal SchemaNamespace As String, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: how to return xml document from a web service
    ... what specific XML you expect. ... If you have a schema that defines what you expect, ... The second issue with this approach is that XML is not a string. ... >> methods from the wire transport. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: xml schema
    ... Strict adherence to an XML standard (schema) must be done ... handle schema validation errors in production. ... .NET XML schema validation classes allow one to do incremental ...
    (microsoft.public.dotnet.languages.csharp)