Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathExc
throw new XPathException(this, ErrorCodes.XQDY0074, "'" + nameSeq.getStringValue() + "' is not a valid attribute name");
}

//Not in the specs but... makes sense
if(!XMLNames.isName(qn.getLocalPart()))
{throw new XPathException(this, ErrorCodes.XQDY0074, "'" + qn.getLocalPart() + "' is not a valid attribute name");}
// Catch illegal QNames
if (!XMLNames.isName(qn.getLocalPart())) {
throw new XPathException(this, ErrorCodes.XPTY0004, "'" + qn.getLocalPart() + "' is not a valid attribute name");
}

if ("xmlns".equals(qn.getLocalPart()) && qn.getNamespaceURI().isEmpty())
{throw new XPathException(this, ErrorCodes.XQDY0044, "'" + qn.getLocalPart() + "' is not a valid attribute name");}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ public Sequence eval(final Sequence contextSequence, final Item contextItem) thr
}
}

//Not in the specs but... makes sense
// Catch Illegal QNames
if (!XMLNames.isName(qn.getLocalPart())) {
throw new XPathException(this, ErrorCodes.XQDY0074, "'" + qnitem.getStringValue() + "' is not a valid element name");
throw new XPathException(this, ErrorCodes.XPTY0004, "'" + qnitem.getStringValue() + "' is not a valid element name");
}

// add namespace declaration nodes
Expand Down