Skip to content

Commit a447391

Browse files
committed
Fix form not populated with XML if minOccurs=0
1 parent 563e724 commit a447391

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

js/html-populators.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//check for input elements existing to handle empty elements
3737
&& o.previousElementSibling.previousElementSibling.querySelector("input, textarea, select")
3838
//check if element has been populated with data from an xml document
39-
&& !o.previousElementSibling.previousElementSibling.querySelector("input, textarea, select").hasAttribute("data-xsd2html2xml-filled")) {
39+
&& Array.from(o.previousElementSibling.previousElementSibling.querySelectorAll("input, textarea, select")).filter(function(el) {return el.hasAttribute("data-xsd2html2xml-filled")}).length == 0) {
4040
clickRemoveButton(
4141
o.parentElement.children[0].querySelector("legend > button.remove, span > button.remove")
4242
);

0 commit comments

Comments
 (0)