You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ayache Khettar <ay...@googlemail.com> on 2014/04/10 13:05:59 UTC
Disable DTD validation on XPATH
Hi
We get XML from third party API which has Doctype declaration (<!DOCTYPE
x_request SYSTEM "https://hostname/dtd/xrequest.dtd">). When XPATH is
invoked it tries to download schema which requires SSL connection and fails
with 403 error code (authentication error). How do we stop Xpath or
SaxParser validating the XML.?
I am aware that programmatically we can set it this way: I am using
blueprint DSL, wondering how to set the below feature?
saxfac.setFeature("
http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
Regards,
akhettar
Re: Disable DTD validation on XPATH
Posted by Ayache Khettar <ay...@googlemail.com>.
By the way, I am removing the DocType declaration from the XML prior to
applying Xpath. It really makes sense to disable validation and if the
latest version does this then it is great.
Ayache
On 10 April 2014 15:04, Ayache Khettar <ay...@googlemail.com>wrote:
> Hi
>
> Thanks guys for your reply. I am using 2.10.7 at the moment.
>
> Regards,
>
> akhettar
>
>
>
> On 10 April 2014 14:18, Claus Ibsen <cl...@gmail.com> wrote:
>
>> Hi
>>
>> What Camel version are you using?
>>
>> I think the DTD validation has been turned off out of the box in the
>> latest releases.
>>
>>
>> On Thu, Apr 10, 2014 at 1:05 PM, Ayache Khettar
>> <ay...@googlemail.com> wrote:
>> > Hi
>> >
>> > We get XML from third party API which has Doctype declaration (<!DOCTYPE
>> > x_request SYSTEM "https://hostname/dtd/xrequest.dtd">). When XPATH is
>> > invoked it tries to download schema which requires SSL connection and
>> fails
>> > with 403 error code (authentication error). How do we stop Xpath or
>> > SaxParser validating the XML.?
>> >
>> > I am aware that programmatically we can set it this way: I am using
>> > blueprint DSL, wondering how to set the below feature?
>> >
>> > saxfac.setFeature("
>> > http://apache.org/xml/features/nonvalidating/load-external-dtd",
>> false);
>> >
>> >
>> > Regards,
>> >
>> > akhettar
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: cibsen@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> hawtio: http://hawt.io/
>> fabric8: http://fabric8.io/
>>
>
>
Re: Disable DTD validation on XPATH
Posted by Ayache Khettar <ay...@googlemail.com>.
Hi
Thanks guys for your reply. I am using 2.10.7 at the moment.
Regards,
akhettar
On 10 April 2014 14:18, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> What Camel version are you using?
>
> I think the DTD validation has been turned off out of the box in the
> latest releases.
>
>
> On Thu, Apr 10, 2014 at 1:05 PM, Ayache Khettar
> <ay...@googlemail.com> wrote:
> > Hi
> >
> > We get XML from third party API which has Doctype declaration (<!DOCTYPE
> > x_request SYSTEM "https://hostname/dtd/xrequest.dtd">). When XPATH is
> > invoked it tries to download schema which requires SSL connection and
> fails
> > with 403 error code (authentication error). How do we stop Xpath or
> > SaxParser validating the XML.?
> >
> > I am aware that programmatically we can set it this way: I am using
> > blueprint DSL, wondering how to set the below feature?
> >
> > saxfac.setFeature("
> > http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
> >
> >
> > Regards,
> >
> > akhettar
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>
Re: Disable DTD validation on XPATH
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
What Camel version are you using?
I think the DTD validation has been turned off out of the box in the
latest releases.
On Thu, Apr 10, 2014 at 1:05 PM, Ayache Khettar
<ay...@googlemail.com> wrote:
> Hi
>
> We get XML from third party API which has Doctype declaration (<!DOCTYPE
> x_request SYSTEM "https://hostname/dtd/xrequest.dtd">). When XPATH is
> invoked it tries to download schema which requires SSL connection and fails
> with 403 error code (authentication error). How do we stop Xpath or
> SaxParser validating the XML.?
>
> I am aware that programmatically we can set it this way: I am using
> blueprint DSL, wondering how to set the below feature?
>
> saxfac.setFeature("
> http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
>
>
> Regards,
>
> akhettar
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
AW: Disable DTD validation on XPATH
Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
You could try setting the factory like described for Saxon in
https://camel.apache.org/xpath.html#XPath-UsingSaxonwithXPathBuilder
https://camel.apache.org/xpath.html#XPath-EnablingSaxonfromSpringDSL
Jan
> -----Ursprüngliche Nachricht-----
> Von: Ayache Khettar [mailto:ayache.khettar@googlemail.com]
> Gesendet: Donnerstag, 10. April 2014 13:06
> An: users@camel.apache.org
> Betreff: Disable DTD validation on XPATH
>
> Hi
>
> We get XML from third party API which has Doctype declaration
> (<!DOCTYPE x_request SYSTEM "https://hostname/dtd/xrequest.dtd">). When
> XPATH is invoked it tries to download schema which requires SSL
> connection and fails with 403 error code (authentication error). How do
> we stop Xpath or SaxParser validating the XML.?
>
> I am aware that programmatically we can set it this way: I am using
> blueprint DSL, wondering how to set the below feature?
>
> saxfac.setFeature("
> http://apache.org/xml/features/nonvalidating/load-external-dtd",
> false);
>
>
> Regards,
>
> akhettar