Revision: 3469 http://vexi.svn.sourceforge.net/vexi/?rev=3469&view=rev Author: clrg Date: 2009-04-01 16:34:36 +0000 (Wed, 01 Apr 2009)
Log Message: ----------- Throw helpful error when encountering repeat attributes with no uri Modified Paths: -------------- trunk/core/org.ibex.util/src/org/ibex/util/XML.java Modified: trunk/core/org.ibex.util/src/org/ibex/util/XML.java =================================================================== --- trunk/core/org.ibex.util/src/org/ibex/util/XML.java 2009-04-01 11:08:10 UTC (rev 3468) +++ trunk/core/org.ibex.util/src/org/ibex/util/XML.java 2009-04-01 16:34:36 UTC (rev 3469) @@ -538,9 +538,12 @@ if (u == null && p != null) error(new Exn("undefined attribute prefix '"+p+"'", Exn.NC, getLine(), getCol())); // check to see if attribute is a repeat - for (int i=0; current.attrSize() > i; i++) if (n.equals(current.getKey(i)) && u.equals(current.getUri(i))) throw new Exn( - "attribute name '"+n+"' may not appear more than once in the same element tag", Exn.WFC, getLine(), getCol() - ); + for (int i=0; current.attrSize() > i; i++) { + if (!n.equals(current.getKey(i))) continue; + if (u==null && current.getUri(i)!=null) continue; + if (u!=null && !u.equals(current.getUri(i))) continue; + throw new Exn("attribute name '"+n+"' may not appear more than once in the same element tag", Exn.WFC, getLine(), getCol()); + } current.addAttr(n, v, u, p); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn