Skip to content

Commit

Permalink
Fix #279 by checking for input decl vs use
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Aug 26, 2018
1 parent 4571b97 commit 4576ad6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/xmlcalabash/model/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,15 @@ private Input readInput(Step parent, XdmNode node) {
String sequence = node.getAttributeValue(new QName("sequence"));
String select = node.getAttributeValue(new QName("select"));

if (!XProcConstants.p_declare_step.equals(parent.node.getNodeName())) {
if (kind != null) {
throw XProcException.staticError(8, node, "The 'kind' attribute is only allowed on an input declaration");
}
if (sequence != null) {
throw XProcException.staticError(8, node, "The 'sequence' attribute is only allowed on an input declaration");
}
}

if (port == null && XProcConstants.p_input.equals(node.getNodeName())) {
throw XProcException.staticError(38, node, "You must specify a port name for all p:input ports.");
}
Expand Down

0 comments on commit 4576ad6

Please sign in to comment.