Skip to content

Instantly share code, notes, and snippets.

@sideshowbarker
Created February 9, 2011 19:34
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/819101 to your computer and use it in GitHub Desktop.
Save sideshowbarker/819101 to your computer and use it in GitHub Desktop.
diff -r a8d67c49a927 relaxng/datatype/java/src/org/whattf/datatype/Refresh.java
--- a/relaxng/datatype/java/src/org/whattf/datatype/Refresh.java Fri Jan 21 16:04:32 2011 +0900
+++ b/relaxng/datatype/java/src/org/whattf/datatype/Refresh.java Thu Feb 10 04:31:51 2011 +0900
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008 Mozilla Foundation
+ * Copyright (c) 2008-2011 Mozilla Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -117,6 +117,20 @@
" instead.");
}
case EQUALS_SEEN:
+ if (c == '"' || c == '\'') {
+ throw newDatatypeException(
+ "Expected an unquoted IRI reference, but saw ",
+ c, " instead.");
+ }
+ if (' ' == c || '\t' == c || '\n' == c || '\f' == c
+ || '\r' == c) {
+ throw newDatatypeException("Expected an IRI reference, but saw whitespace instead.");
+ }
+ char l = literal.charAt(literal.length() - 1);
+ if (' ' == l || '\t' == l || '\n' == l || '\f' == l
+ || '\r' == l) {
+ throw newDatatypeException("Trailing whitespace.");
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment