From: <sha...@us...> - 2010-07-31 17:04:42
|
Revision: 12166 http://exist.svn.sourceforge.net/exist/?rev=12166&view=rev Author: shabanovd Date: 2010-07-31 17:04:36 +0000 (Sat, 31 Jul 2010) Log Message: ----------- [bugfix] catch IllegalArgumentException for wrong qname @ attribute constructor Modified Paths: -------------- trunk/eXist/src/org/exist/xquery/DynamicAttributeConstructor.java Modified: trunk/eXist/src/org/exist/xquery/DynamicAttributeConstructor.java =================================================================== --- trunk/eXist/src/org/exist/xquery/DynamicAttributeConstructor.java 2010-07-31 17:03:33 UTC (rev 12165) +++ trunk/eXist/src/org/exist/xquery/DynamicAttributeConstructor.java 2010-07-31 17:04:36 UTC (rev 12166) @@ -110,11 +110,15 @@ if (qnItem.getType() == Type.QNAME) qn = ((QNameValue) qnItem).getQName(); else - qn = QName.parse(context, nameSeq.getStringValue(), null); + try { + qn = QName.parse(context, nameSeq.getStringValue(), null); + } catch (IllegalArgumentException e) { + throw new XPathException(this, "XPTY0004 '" + nameSeq.getStringValue() + "' is not a valid attribute name"); + } //Not in the specs but... makes sense if(!XMLChar.isValidName(qn.getLocalName())) - throw new XPathException(this, "XPTY0004 '" + qn.getLocalName() + "' is not a valid attribute name"); + throw new XPathException(this, "XPTY0004 '" + qn.getLocalName() + "' is not a valid attribute name"); String value; Sequence valueSeq = valueExpr.eval(contextSequence, contextItem); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |