You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/01/11 05:11:16 UTC

DO NOT REPLY [Bug 5800] New: - getSystemId() returns relative path from the Locator

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=5800>.
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=5800

getSystemId() returns relative path from the Locator

           Summary: getSystemId() returns relative path from the Locator
           Product: Xerces2-J
           Version: 2.0.0 [beta 4]
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: SAX
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: eddie@allette.com.au


When validating an XML document that have an error in an external entity the 
getSystemId() method from the SAXParseException returns only the relative path 
to the entity. Is this correct behaviour?
Here is the example:

XML File:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE root [
	<!ELEMENT root (#PCDATA)>
	<!ENTITY % pe1 SYSTEM "ibm68i04.ent">
	%pe1;
]>
<root>
	dfssdf
</root>

The "ibm68i04.ent" contains the following:

<!ELEMENT a EMPTY>
<!ATTLIST a
	attr1 CDATA "&ge1;"
>
<!ENTITY ge1 "abcdef">
<!--* GE reference in attr default before declaration *-->

When running Xerces and validating the first XML File I correclty get the error 
message:

Error: The entity "ge1" was referenced, but not declared.

The problem is that the getSystemId() function from the exception returns only 
the relative path to the entity: "ibm68i04.ent".
This is not much use to me because I need to get access to this external entity 
but without the resolved entity location there's no way I can get this. Is this 
correct?
In the SAX documentation it says (for the SAXParseException.getSystemId()):

"If the system identifier is a URL, it will be resolved fully."

Doesn't this mean that the returned value from getSystemId() should be an 
absolut path?
If the current behaviour is correct then is there another way of resolving the 
relative path of the external entity?

Cheers,
/Eddie

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org