Skip to content

Commit

Permalink
Improved Fix for issue alkacon#296: Filter elements no longer contain…
Browse files Browse the repository at this point in the history
…ed in the choice definition
  • Loading branch information
kaiwidmann committed Feb 11, 2015
1 parent 090e2c7 commit abd07a5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/org/opencms/xml/A_CmsXmlDocument.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,17 @@ public CmsFile correctXmlStructure(CmsObject cms) throws CmsXmlException {
// if it's a multiple choice element, the child elements must not be sorted into their types,
// but must keep their original order
if (isMultipleChoice) {
List<Element> nodeList = new ArrayList<Element>();
List<Element> elements = CmsXmlGenericWrapper.elements(root);
checkMaxOccurs(elements, cd.getChoiceMaxOccurs(), cd.getTypeName());
nodeLists.add(elements);
Set<String> typeNames = cd.getSchemaTypes();
for (Element element : elements) {
// check if the node type is still in the definition
if (typeNames.contains(element.getName())) {
nodeList.add(element);
}
}
checkMaxOccurs(nodeList, cd.getChoiceMaxOccurs(), cd.getTypeName());
nodeLists.add(nodeList);
}
// if it's a sequence, the children are sorted according to the sequence type definition
else {
Expand Down

0 comments on commit abd07a5

Please sign in to comment.