/** * Gets the DOM tree associated with the specified system ID, * or null if none is found. */ public Document get( String systemId ) { Document doc = core.get(systemId); if( doc==null && systemId.startsWith("file:/") && !systemId.startsWith("file://") ) { // As of JDK1.4, java.net.URL.toExternal method returns URLs like // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738. // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"), // and this descripancy breaks DOM look up by system ID. // this extra check solves this problem. doc = core.get( "file://"+systemId.substring(5) ); } if( doc==null && systemId.startsWith("file:") ) { // on Windows, filenames are case insensitive. // perform case-insensitive search for improved user experience String systemPath = getPath(systemId); for (String key : core.keySet()) { if(key.startsWith("file:") && getPath(key).equalsIgnoreCase(systemPath)) { doc = core.get(key); break; } } } return doc; }
/** * Gets the DOM tree associated with the specified system ID, * or null if none is found. */ public Document get( String systemId ) { Document doc = core.get(systemId); if( doc==null && systemId.startsWith("file:/") && !systemId.startsWith("file://") ) { // As of JDK1.4, java.net.URL.toExternal method returns URLs like // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738. // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"), // and this descripancy breaks DOM look up by system ID. // this extra check solves this problem. doc = core.get( "file://"+systemId.substring(5) ); } if( doc==null && systemId.startsWith("file:") ) { // on Windows, filenames are case insensitive. // perform case-insensitive search for improved user experience String systemPath = getPath(systemId); for (String key : core.keySet()) { if(key.startsWith("file:") && getPath(key).equalsIgnoreCase(systemPath)) { doc = core.get(key); break; } } } return doc; }
/** * Gets the DOM tree associated with the specified system ID, * or null if none is found. */ public Document get( String systemId ) { Document doc = core.get(systemId); if( doc==null && systemId.startsWith("file:/") && !systemId.startsWith("file://") ) { // As of JDK1.4, java.net.URL.toExternal method returns URLs like // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738. // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"), // and this descripancy breaks DOM look up by system ID. // this extra check solves this problem. doc = core.get( "file://"+systemId.substring(5) ); } if( doc==null && systemId.startsWith("file:") ) { // on Windows, filenames are case insensitive. // perform case-insensitive search for improved user experience String systemPath = getPath(systemId); for (String key : core.keySet()) { if(key.startsWith("file:") && getPath(key).equalsIgnoreCase(systemPath)) { doc = core.get(key); break; } } } return doc; }
/** * Gets the DOM tree associated with the specified system ID, * or null if none is found. */ public Document get( String systemId ) { Document doc = core.get(systemId); if( doc==null && systemId.startsWith("file:/") && !systemId.startsWith("file://") ) { // As of JDK1.4, java.net.URL.toExternal method returns URLs like // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738. // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"), // and this descripancy breaks DOM look up by system ID. // this extra check solves this problem. doc = core.get( "file://"+systemId.substring(5) ); } if( doc==null && systemId.startsWith("file:") ) { // on Windows, filenames are case insensitive. // perform case-insensitive search for improved user experience String systemPath = getPath(systemId); for (String key : core.keySet()) { if(key.startsWith("file:") && getPath(key).equalsIgnoreCase(systemPath)) { doc = core.get(key); break; } } } return doc; }
/** * Gets the DOM tree associated with the specified system ID, * or null if none is found. */ public Document get( String systemId ) { Document doc = core.get(systemId); if( doc==null && systemId.startsWith("file:/") && !systemId.startsWith("file://") ) { // As of JDK1.4, java.net.URL.toExternal method returns URLs like // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738. // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"), // and this descripancy breaks DOM look up by system ID. // this extra check solves this problem. doc = core.get( "file://"+systemId.substring(5) ); } if( doc==null && systemId.startsWith("file:") ) { // on Windows, filenames are case insensitive. // perform case-insensitive search for improved user experience String systemPath = getPath(systemId); for (String key : core.keySet()) { if(key.startsWith("file:") && getPath(key).equalsIgnoreCase(systemPath)) { doc = core.get(key); break; } } } return doc; }