Thanks a lot! I will try this as soon as I get the chance.
I'm not sure about the need for a DTD catalog in my situation, have to read up on this first.
Thanks,
Matthijs


robert burrell donkin wrote:

if you're talking about XML validation then one option that hasn't been mentioned yet is to use a custom EntityResolver which knows how to supply the DTDs you're using. for example

digester.setEntityResolver(new MyEntityResolver());

you might like to consider using a catalog for the DTDs. if so then maybe http://xml.apache.org/commons/components/resolver/index.html would be of some help.

- robert

On Thursday, September 18, 2003, at 11:55 PM, Matthijs Wensveen wrote:

I have a similar problem, but maybe a bit more complex.
The XML I want to digest consists of elements defined in one or more namespaces. For example:
<cfg:configuration cfg:xmlns="..">
<p:properties name="myProps">
<p:property key="key1" value="value1" />
<p:property key="key2" value="value2" />
</p:properties>


   <cp:connectionpool>
       <cp:db... etc....
   </cp:connectionpool>
<cfg:configuration>

Is there a way to validate each namespace separately. Because for each application we use different xml with similar elements, this would be very useful. Maybe this is a question for another (more xml specific) mailing list, at least I couldn't find anything useful on the net.
If the answer includes separating the validation process from the rest that's fine (maybe even better so I can turn validation on or off).


Regards,
Matthijs.

Craig R. McClanahan wrote:

On Thu, 18 Sep 2003, Phillip Qin wrote:


Date: Thu, 18 Sep 2003 14:05:49 -0400
From: Phillip Qin <[EMAIL PROTECTED]>
Reply-To: Jakarta Commons Users List <[EMAIL PROTECTED]>
To: 'Jakarta Commons Users List' <[EMAIL PROTECTED]>
Subject: RE: [digester] validating against system dtd?

Craig,

If I don't use InputSource, is following snippet "not to avoid"?

    Digester d = DigesterLoader.createDigester(url);
    d.push(this);
    d.parse(input);



The key question is what "input" is. If it's an InputStream, then the XML
parser has no way to know what the absolute URL of the input document was,
and therefore no way to resolve relative URLs. (The URL you pass to
createDigester() is for the XML document containing the Digester rules,
not the XML document to be parsed.)


Note that this issue is by no means specific to Digester -- it'll happen
to you with direct calls to DOM or SAX parsers as well, because it is the
XML parser that actually resolves these things. Digester doesn't have a
clue.


Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to