summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/list/library.lst5
-rw-r--r--sources/scala/xml/MalformedAttributeException.scala3
-rw-r--r--sources/scala/xml/PrefixedAttribute.scala6
-rw-r--r--sources/scala/xml/UnprefixedAttribute.scala6
4 files changed, 20 insertions, 0 deletions
diff --git a/config/list/library.lst b/config/list/library.lst
index 42dae1a24c..cfe1d974e7 100644
--- a/config/list/library.lst
+++ b/config/list/library.lst
@@ -335,6 +335,7 @@ xml/Comment.scala
xml/Document.scala
xml/Elem.scala
xml/EntityRef.scala
+xml/MalformedAttributeException.scala
xml/MetaData.scala
xml/Molecule.scala
xml/NamespaceBinding.scala
@@ -391,4 +392,8 @@ xml/transform/BasicTransformer.scala
xml/transform/RewriteRule.scala
xml/transform/RuleTransformer.scala
+#xml/xsd/Decl.scala
+#xml/xsd/ContentModel.scala
+#xml/xsd/XsTypeSymbol.scala
+
##############################################################################
diff --git a/sources/scala/xml/MalformedAttributeException.scala b/sources/scala/xml/MalformedAttributeException.scala
new file mode 100644
index 0000000000..bcb4c0f393
--- /dev/null
+++ b/sources/scala/xml/MalformedAttributeException.scala
@@ -0,0 +1,3 @@
+package scala.xml;
+
+case class MalformedAttributeException(msg:String) extends java.lang.RuntimeException(msg);
diff --git a/sources/scala/xml/PrefixedAttribute.scala b/sources/scala/xml/PrefixedAttribute.scala
index 9ceecc45ff..38fb907a24 100644
--- a/sources/scala/xml/PrefixedAttribute.scala
+++ b/sources/scala/xml/PrefixedAttribute.scala
@@ -17,6 +17,12 @@ class PrefixedAttribute(val pre: String,
val value: String,
val next: MetaData) extends MetaData {
+ // verify that value is a proper attribute value (references, no <)
+ Utility.checkAttributeValue(value) match {
+ case null => ;
+ case msg => throw new MalformedAttributeException(msg);
+ }
+
/** Returns a copy of this unprefixed attribute with the given
* next field.
*/
diff --git a/sources/scala/xml/UnprefixedAttribute.scala b/sources/scala/xml/UnprefixedAttribute.scala
index b00b25f31c..82d30ac804 100644
--- a/sources/scala/xml/UnprefixedAttribute.scala
+++ b/sources/scala/xml/UnprefixedAttribute.scala
@@ -14,6 +14,12 @@ package scala.xml;
*/
class UnprefixedAttribute(val key: String, val value: String, val next: MetaData) extends MetaData {
+ // verify that value is a proper attribute value (references, no <)
+ Utility.checkAttributeValue(value) match {
+ case null => ;
+ case msg => throw new MalformedAttributeException(msg);
+ }
+
/** returns a copy of this unprefixed attribute with the given next field*/
def copy(next: MetaData) =
new UnprefixedAttribute(key, value, next);