|
|
@@ -126,7 +126,7 @@ class XML {
|
|
|
DBG::log($type, 'array', "findElementType \$fieldName='{$fieldName}' type='{$nodeArray[1]['type']}' => type='{$type}'");
|
|
|
// check restrictions - if has enumeration then return 'p5:enum'
|
|
|
$isEnum = false;
|
|
|
- foreach ($restrictionNode[2] as $restr) {
|
|
|
+ if (!empty($restrictionNode[2])) foreach ($restrictionNode[2] as $restr) {
|
|
|
if ('enumeration' === self::getTagName($restr[0])) {
|
|
|
$isEnum = true;
|
|
|
break;
|
|
|
@@ -261,7 +261,7 @@ class XML {
|
|
|
$restrictions = [];
|
|
|
if (empty($restrictionNode[1]['base'])) throw new Exception("Missing 'xsd:restriction/@base' for field '{$fieldName}'");
|
|
|
// xsd:simpleType/xsd:restriction/xsd:string
|
|
|
- foreach ($restrictionNode[2] as $tagRestriction) {
|
|
|
+ if (!empty($restrictionNode[2])) foreach ($restrictionNode[2] as $tagRestriction) {
|
|
|
// xsd:string/xsd:maxLength
|
|
|
$val = $tagRestriction[1]['value'];
|
|
|
if ('enumeration' == XML::getTagName($tagRestriction[0])) {
|