Skip Menu |

This queue is for tickets about the XML-Checker CPAN distribution.

Report information
The Basics
Id: 6222
Status: new
Priority: 0/
Queue: XML-Checker

People
Owner: Nobody in particular
Requestors: fred.kubli [...] ubs.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.13
Fixed in: (no value)



Subject: XML::Checker::Parser::map_uri not working ??
Hello: This might not be a bug at all, but I have trouble reading the source properly and I am left wondering if I understand its flow properly. I am trying to detect an order issue in a J2EE web.xml by validating it against its dtd. The xml file has a a DTD set to: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> When I run my script I get an error connecting to sun.com to get the dtd file. I do not want to set the LWP to pass through the firewalls but use a local disk copy. So I set in my script: XML::Checker::Parser::map_uri ( "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" => "web-app_2_3.dtd" ); However, instead of using the local file copy of web-app_2_3.dtd, I still get an error connecting to sun.com. In the Parser.pm code it appears that if there is a valid: $URI_MAP{$sysid} it will take that value .... My testing seems to show that it is ignored. Could you be so kind and take a couple minute to confirm that it is possible to supersede the dtd location value without editing the original xml file's DOCTYPE. Your help is greatly appreciated. Many thanks, Kind Regards - Fred Kubli Perot Systems Corp., Connecticut
From: fred.kubli [...] ubs.com
Hello: I figured out that the problem is only in the XML::Checker::Parser perldoc and cpan documentation. So this might have been obvious for non-XML beginners :) In the XML::Checker::Parser doc, instead of: map_uri (pubid => uri, ...) To define the location of PUBLIC ids, as found in DOCTYPE declarations after the PUBLIC keyword, e.g. XML::Checker::Parser::map_uri ( "-//W3C//DTD HTML 4.0//EN" => "file:/user/html.dtd"); you should read: map_uri (sysid => uri, ...) To define the location of SYSTEM ids, as found in DOCTYPE declarations after the PUBLIC id, e.g. XML::Checker::Parser::map_uri ( "http://www.w3.org/TR/html4/strict.dtd" => "file:/user/html.dtd"); Currently the module appears coded to use sysid. I wonder if the pubid isn't better afterall, but now you might have a legacy. Maybe both are possible eg. if $URI_MAP{$sysid} is not defined maybe $URI_MAP {$pubid} is and thus use this uri. Kind Regards - Fred