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

RE: Parser Behaviour (Serious- isSolved?)

  • From: "gopi" <gopi@a...>
  • To: <xml-dev@x...>, <Bruce.Durling@e...>
  • Date: Tue, 4 Apr 2000 21:24:57 +0530

domparser example
Hi all,
	I still wonder why Xerces developers didn't pitched in and tried to answer
this question?
If I have not mistaken, what Peter Murray's problem is, he doesn't want to
change his "each" xml file to make references to local directory DTD files.
When he is using it on laptop (offline), he wants to make reference to local
directory DTD's and exact DTD URL when online.
	If you take snapshot of recent Xerces Java from apache website and generate
javadoc.

	The package org.apache.xerces.readers has classes XCatalog and
XMLCatalogHandler.
They implement the Catalog specification available at URL
http://www.ccil.org/~cowan/XML/XCatalog.html.  The following line I have
quoted from
the URL
"XML Catalogs are Web resources (anything from local files on up) which
contain mappings from public identifiers to system identifiers (and
optionally mappings from system identifiers to other system identifiers),
plus references to other XML Catalogs."
	John Cawon had posted proposal draft 0.2 on xml-dev list sometime back
(according to the description given in URL). See the URL for more info

	So, what we need to do is have different "catalog files" when using online
and offline.  Use these catalog files in your application.  When you want to
use offline, use catalog file which maps these external DTD references (to
say w3c website) to your local DTD copy.  If you want to use these exact
external references use catalog file without these mappings.  The problem
will be solved. [I hope so :-)].

	I was just about to send the mail, I got mail from Bruce. I guess this
anwers ur query.

	XCatalog catalog = new XCatalog();
	catalog.loadCatalog(new InputSource(new
FileInputStream("d:\\xml\\catalog.xml")));
	DOMParser parser = new DOMParser();
	parser.setEntityResolver(catalog);

	// go ahead with your application specific calls. Njoy :-)
	FYI:  XCatalog extends from XMLCatalogHandler.  XMLCatalogHandler
implements EntityResolver.

	I don't know how to handle with other parsers like XP?
regards,
Gopinath M.R.
Software Engineer,
Aztec software and technology services (P) Ltd ( www.aztec.soft.net )
Bangalore -560078
email : gopi@a... <mailto:gopi@a...>
gopinathmr@b... <mailto:gopinathmr@b...>
"XML data is not slow, the implementation is making it slow"

-----Original Message-----
From: owner-xml-dev@x... [mailto:owner-xml-dev@x...]On Behalf Of
Bruce.Durling@e...
Sent: Tuesday, April 04, 2000 12:59 PM
To: xml-dev@x...
Subject: using catalog files (Was Re:Parser Behaviour (Serious))




I've heard a number of people mention using catalog files. I've thought
about
this myself and it seems to be a solution. Can anyone give an example of how
to
use them with current parsers such as Xerces? I've been looking through the
docs
and it hasn't been exactly clear. I'm sorry if this is the wrong place to
ask
and please feel free to direct me (and others?) to the appropriate TFM which
I
will gladly R.

cheers,
bld
an xml confusbie



***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************


***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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.