OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: Parser Behaviour (Serious- isSolved?)

[ Lists Home | Date Index | Thread Index ]
  • From: "gopi" <gopi@aztecsoft.com>
  • To: <xml-dev@xml.org>, <Bruce.Durling@equifax.com>
  • Date: Tue, 4 Apr 2000 21:24:57 +0530

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@aztecsoft.com <mailto:gopi@aztecsoft.com>
gopinathmr@bigfoot.com <mailto:gopinathmr@bigfoot.com>
"XML data is not slow, the implementation is making it slow"

-----Original Message-----
From: owner-xml-dev@xml.org [mailto:owner-xml-dev@xml.org]On Behalf Of
Bruce.Durling@equifax.com
Sent: Tuesday, April 04, 2000 12:59 PM
To: xml-dev@xml.org
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@xml.org&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@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************




 

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

Copyright 2001 XML.org. This site is hosted by OASIS