DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3880>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3880

Error: DTD file not found if XML file name contains character such as "%"

           Summary: Error: DTD file not found if XML file name contains
                    character such as "%"
           Product: Xerces2-J
           Version: 2.0.0 [beta 2]
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: SAX
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


We are using SAX parser in our new project. 
An XML file, given a normal file name, such as "test.xml", is working fine 
towards SAX parser. But after changing the file name to "tes%t.xml", throws 
error:
org.xml.sax.SAXParseException: File "test.dtd" not found.
        at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:975)

        at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExtern
alEntity(DefaultEntityHandler.java:755)
        at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExtern
alSubset(DefaultEntityHandler.java:566)
        at org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScann
er.java:1131)
        at org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDoc
umentScanner.java:2177)
        at org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentSc
anner.java:2133)
        at org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispa
tch(XMLDocumentScanner.java:882)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:380)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)

Tried Xerces 1.3.1, 1.4.3 and Xerces 2.0.0 (beta 2), get the same error.
The following char.s in the file name will get the same exception:
{, }, [, ], ^, `

Here is the first two lines of the XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE INF_TEST_METADATA SYSTEM "test.dtd">

If no DTD is defined in the XML and if I disable the validation against DTD 
option for the parser (
((XMLReader)parser).setFeature("http://xml.org/sax/features/validation";, false);
) no exception will occur.
Thanks,
Yinghua

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

Reply via email to