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

Compelling use case for XML Catalogs?

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Fri, 10 Jun 2011 14:02:40 -0400

Compelling use case for XML Catalogs?
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


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


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.