Skip to content

Instantly share code, notes, and snippets.

@sideshowbarker
Created October 18, 2011 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sideshowbarker/1294834 to your computer and use it in GitHub Desktop.
Save sideshowbarker/1294834 to your computer and use it in GitHub Desktop.
diff -r 5922374b5f63 src/nu/validator/gnu/xml/aelfred2/SAXDriver.java
--- a/src/nu/validator/gnu/xml/aelfred2/SAXDriver.java Thu Dec 23 16:14:07 2010 +0900
+++ b/src/nu/validator/gnu/xml/aelfred2/SAXDriver.java Tue Oct 18 16:44:42 2011 +0900
@@ -820,6 +820,8 @@
}
private void declarePrefix(String prefix, String uri) throws SAXException {
+ // NOTE: uri may be the empty string
+
int index = uri.indexOf(':');
// many versions of nwalsh docbook stylesheets
@@ -829,7 +831,7 @@
}
// char [0] must be ascii alpha [RFC 2396]
- if (!isAlpha(uri.charAt(0))) {
+ if (uri.length() != 0 && !isAlpha(uri.charAt(0))) {
fatal("First character of the URI must be ascii alpha");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment