jjmoka has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use XML::Validate::Xerces; sub main { my $rsep = $/; undef $/; my $xml = <DATA>; $/ = $rsep; warn "working on this xml:[\n$xml]"; my %options; my $validator = new XML::Validate::Xerces(%options); my $valid = $validator->validate($xml) ? '' : 'in'; warn "Document is ${valid}valid\n"; } main(); __DATA__ <?xml version="1.0"?> <note xmlns="https://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.w3schools.com http://www.w3schools.c +om/xml/note.xsd"> <!-- xsi:schemaLocation="https://www.w3schools.com file:///root/stef/note +.xsd"> --> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
If I swap with the commented out line (i.e. I change http://www.w3schools.com/xml/note.xsd to be file:///root/stef/note.xsd) so with the schema as a local file, then it works fine even in B-NOK.
The only difference then seems when the schema is on http.
Note that, the local file was downloaded as wget http://www.w3schools.com/xml/note.xsd so that not only I know that the content of the schema file is the same (local & remote) but also that http:80 works fine to catch stuff out there.
I didn't do anything special to have Xerces working over http:80 for server A-OK. I would then expect to do nothing on server B-NOK to have Xerces going out there and grab the schema.
I didn't find clear info if/how Xerces should be instructed to use http. Neither which mechanism it has built-in, to behave like wget to download URLs. I cannot understand then if I must add some config vars. The admin of server B-NOK told me that he didn't see anything attempting to reach http://www.w3schools.com apart when doing the manual wget. This does seem Xerces doesn't bother at all to get that URL.
Really thank you in advance for any hint.
====================== SOLVED / UPDATE ================ I wasn't given details but network settings on B-NOK server and behind have been performed and currently that fixed my issue. I'm left then embarrassed to come here and apologise to everyone for the time spent on this. To be honest I've spent ages and I didn't know what much else to try. I've had the opportunity to learn from the good advices received so that's still a positive outcome for me. For you instead again my apologies. ====================== SOLVED / UPDATE ================
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How Xerces validation access http schemas ?
by hippo (Archbishop) on Apr 08, 2021 at 12:33 UTC | |
by Anonymous Monk on Apr 08, 2021 at 16:01 UTC | |
|
Re: How Xerces validation access http schemas ?
by ikegami (Patriarch) on Apr 09, 2021 at 02:47 UTC | |
by jjmoka (Beadle) on Apr 09, 2021 at 10:36 UTC | |
|
Re: How Xerces validation access http schemas ?
by bliako (Abbot) on Apr 08, 2021 at 20:04 UTC | |
|
Re: How Xerces validation access http schemas ?
by jcb (Parson) on Apr 08, 2021 at 23:38 UTC |