Permalink
Browse files

Fix #279 by checking for input decl vs use

  • Loading branch information...
ndw committed Aug 26, 2018
1 parent 4571b97 commit 4576ad69736bb00eb00c20b3810412d28aeb054b
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/main/java/com/xmlcalabash/model/Parser.java
@@ -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.");
}

0 comments on commit 4576ad6

Please sign in to comment.