XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Compelling use case for XML Catalogs?

To elaborate on what I meant by 'earlier standards' I was thinking
of DTDs and the reliance earlier XML standardised markups had
on them. DTDs had several ways that they could use URLs to point
to remote resources so it was especially necessary to allow these
to be redirected locally. I'm guessing the main use was to allow a
docbook document referring to a standard OASIS Docbook DTD
published on the OASIS site to have a local copy of the DTD to
avoid problems that probably existed in the early days of XML
(when it depended on DTDs) e.g. with offline parsing. Not to say
there aren't still occasions where such problems occur but parsers I
think that once XML standard formats get widespread use the
software can be written to expect them and have built in ways of
recognising a namespace and domain-specific parsing requirements
and not need XML Catalogs so much.

----
Stephen D Green



On 11 June 2011 08:38, Stephen D Green <stephengreenubl@gmail.com> wrote:
I suggest that XML Catalogs may be solving a problem
which can occur when the XML is standardised by a remote
standards body which publishes a standard URL for a
schema. There is a risk that conforming documents will
include a schema location linking to the remote, published
schema: The inclusion of such a URL combined with any
software which tries to resolve that link when it parses the
XML documents might result in excessive requests to the
remote resource, tying both the remote servers and the
local network and Internet connections. I think this scenario
might be less of a concern as software is being designed
with regard for domain requirements but once upon a time
software handling XML possibly tended to stick to generic
patterns (earlier standards?) in managing the XML and this
might have meant always trying to resolve such URLs using
the Internet by default. I imagine today most software can
be configured others ways than with XML Catalogs alone
as it has become more sophisticated and adapted to user
requirements.
----
Stephen D Green



On 10 June 2011 19:02, Costello, Roger L. <costello@mitre.org> wrote:
Hi Folks,

XML Catalogs are used to map URLs in XML files to local resources.

EXAMPLE #1

This XML Schema document <xsd:include>s a file that is at a URL:

-------------------------------------------------------------------------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <xsd:include schemaLocation="http://www.xfront.com/catalog-test/Author.xsd" />

   ...

</xsd:schema>
-------------------------------------------------------------------------------------

An XML Catalog is used to specify a mapping from that URL to a local copy:

-------------------------------------------------------------------------------------
<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

   <uri name="http://www.xfront.com/catalog-test/Author.xsd"
          uri="Author.xsd"/>

</catalog>
-------------------------------------------------------------------------------------

When the XML Schema is executed, an XML Catalog tool will dynamically perform the mapping and the XML Schema will use the local copy of Author.xsd rather than the version at the URL.

Let's take an XSLT example.

EXAMPLE #2

This XSLT document uses the document() function to access a file that is at a URL:

-------------------------------------------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                       version="1.0">

   <xsl:value-of select="document('http://www.xfront.com/FitnessCenter.xml')"/>
   ...
</xsl:stylesheet>
-------------------------------------------------------------------------------------

An XML Catalog is used to specify a mapping from that URL to a local copy:

-------------------------------------------------------------------------------------
<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

   <uri name=" http://www.xfront.com/FitnessCenter.xml "
          uri="FitnessCenter.xsl"/>

</catalog>
-------------------------------------------------------------------------------------

When the XSLT is executed, an XML Catalog tool will dynamically perform the mapping and the XSLT will use the local copy of FitnessCenter.xsl rather than the version at the URL.

QUESTIONS

In a real operational environment, wouldn't you always have your own local copies of XML Schemas, XSLT programs, Schematron schemas? And wouldn't they all be configured to reference local resources? Further, when an XML document arrives from the network, you may not know what URLs it contains and you don't want processing to dereference them, so how can you possibly create, in advance, an XML Catalog? Given that, there seems to be no non-trivial use for XML Catalogs.

Would you provide a compelling use case for XML Catalogs please?

/Roger

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS