RE: "Protocol scheme 'c' is not supported ..."
by F. DR EECS Mabry other posts by this author
Oct 1 2009 1:02PM messages near this date
view in the new Beta List Site
Re: Xpath problem?
|
RE: "Protocol scheme 'c' is not supported ..."
& XSLT Allen
> Date: Thu, 1 Oct 2009 11:35:22 -0400
> From: "Allen, Christopher" <christopher.allen@[...].com>
> Subject: "Protocol scheme 'c' is not supported ..."
> To: <perl-xml@[...].com>
> Message-ID:
> <D9DF23CF9A82EA4E84EFD144BEEFC4481DA1AA@[...].net>
> I have a doc that refers to a DTD like this:
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> and the doc's "outer element" is:
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
> debug="false">
>
> I'm trying to read the doc with:
> $cxml = XML::XPath->new(filename => $cfile);
>
> and I get this error:
>
> 501 Protocol scheme 'c' is not supported c:/dir/subdir/log4j.dtd
> Handler couldn't resolve external entity at line 2, column 48, byte 87
> error in processing external entity reference at line 2, column 48, byte
> 87:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> ===============================================^
> ...
I believe that you should NOT have the "log4j:" preceding the name ("configuration" in this
case).
From the w3c xml document
<?xml version="1.0"?>
<!DOCTYPE greeting SYSTEM "hello.dtd">
<greeting> Hello, world!</greeting>
Note: the "greeting" on line 2 matches the element name on line 3. The DTD definition preda
tes the namespace recommendation. The "log4j:" is a reference to the identified namespace w
ithin the XML content. I think this is the source of the problem.
Note: with some of the Perl XML packages you have to be careful to indicate to the package t
hat you are processing content that is registered against some namespace. Just because ther
e is a namespace identified in the input XML that happens to match the one you may want to r
eference in your XPATH expressions that does not mean that the intermediate package will kno
w to match the prefix (log4j) in a string constant with the namespace identification ("http:
//jakarta.apache.org/log4j/") included in the input file. You could be using "LOG4J" as a p
refix in your Perl XPATH expressions (or even "perlLOG4J"). If you indicate that you want t
o use a particular namespace prefix and indicate the mapping of prefix to namespace identifi
cation then your program will meet your expectations. Hope this helps.
Frank
Dr. Frank J. Mabry, Jr., CISSP
Associate Professor
IT AIAD Coordinator
Dept. of EE&CS
U.S. Military Academy
West Point, New York, 10996
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
F. DR EECS Mabry
Christopher Allen
Robin Berjon
|