You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Brad O'Hearne <ca...@megapathdsl.net> on 2001/02/09 02:48:17 UTC

How to create a validating SAXParser?

Hello all,

Got an easy question for you.  In SAX2, I want to manipulate the features
and properties of the parser that I create (like making an instance of a
SAXParser a validating parser).  Is there anywhere that I can find a global
listing of all of the supported features and/or properties that the
SAXParser recognizes?  I read in the API docs the following:

"XMLReaders are not required to recognize setting any specific property
names, though a core set is provided with SAX2."

Where can I find this core set?

(Actually, my question is really how to set my parser to validating mode,
but I am also curious about the other options I can manipulate in the
parser.)

Thanks in advance.

Brad


Re: SystemID sent to EntityResolver contains absolute path

Posted by Milind Gadre <mi...@ecplatforms.com>.
Brad, I found this behavior to be extremely annoying also. The
documentation states that the system id in the document is converted to
a url format *before* handing off to the entity resolver. It is unclear
why it cannot be passed in as is also, maybe as a 3rd parameter. Or
better still, have a prior step where a 'URLConverter' class decides how
it is to be converted instead of applying a hardcoded rule blindly.

For your specific situation (which was similar to what I wanted), I
ended up using a PUBLIC identifier, and leaving the system id empty. I
then used this logic

1. if the system id is empty, look up the dtd from a known location
based on the public id

2. else, we have a fully specified dtd url, so let the default mechanism
handle it

Hope this helps ....

Regards...

Milind Gadre
ecPlatforms, Inc
901 Mariner's Island Blvd, Suite 565
San Mateo, CA 94404
C: 510-919-0596
F: 815-352-0779
milind@ecplatforms.com

----- Original Message -----
From: "Brad O'Hearne" <ca...@megapathdsl.net>
To: <xe...@xml.apache.org>
Sent: Thursday, February 15, 2001 7:13 AM
Subject: SystemID sent to EntityResolver contains absolute path


> Hello all,
>
> I am using an EntityResolver to resolve the proper value for my DTD
referred
> to in my xml file.  I have no path in the xml file, just the dtd name,
i.e.
> "brad.dtd".  However, when the resolveEntity method is called, the
value
> passed to the publicId parameter is NULL and the value passed to the
> systemId parameter is not simply "brad.dtd", but something like the
> following: "file:///data/dev/brad.dtd".  Is there any way just to
receive
> the actual value in the xml file, "brad.dtd"?
>
> Brad
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>


SystemID sent to EntityResolver contains absolute path

Posted by Brad O'Hearne <ca...@megapathdsl.net>.
Hello all,

I am using an EntityResolver to resolve the proper value for my DTD referred
to in my xml file.  I have no path in the xml file, just the dtd name, i.e.
"brad.dtd".  However, when the resolveEntity method is called, the value
passed to the publicId parameter is NULL and the value passed to the
systemId parameter is not simply "brad.dtd", but something like the
following: "file:///data/dev/brad.dtd".  Is there any way just to receive
the actual value in the xml file, "brad.dtd"?

Brad


Re: How to create a validating SAXParser?

Posted by Ian Roberts <ir...@decisionsoft.com>.
On Thu, 8 Feb 2001, Brad O'Hearne wrote:

> Hello all,
> 
> Got an easy question for you.  In SAX2, I want to manipulate the features
> and properties of the parser that I create (like making an instance of a
> SAXParser a validating parser).  Is there anywhere that I can find a global
> listing of all of the supported features and/or properties that the
> SAXParser recognizes?  I read in the API docs the following:

http://xml.apache.org/xerces-j/features.html

Ian

-- 
Ian Roberts, Software Engineer        DecisionSoft Ltd.
tel: +44-1865-203192                  http://www.decisionsoft.com