Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1064/src/org/sblim/cimclient/internal/cimxml
Modified Files:
Tag: Experimental
CIMXMLParserImpl.java
Log Message:
2686 parseEXPPARAMVALUE allows 2+ children, prohibits 0
Index: CIMXMLParserImpl.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/CIMXMLParserImpl.java,v
retrieving revision 1.14.2.56
retrieving revision 1.14.2.57
diff -u -d -r1.14.2.56 -r1.14.2.57
--- CIMXMLParserImpl.java 7 Oct 2013 21:55:35 -0000 1.14.2.56
+++ CIMXMLParserImpl.java 10 Oct 2013 11:01:04 -0000 1.14.2.57
@@ -73,6 +73,7 @@
* 2683 2013-10-07 blaschke-oss KEYVALUE VALUETYPE optional, "string" default
* 2684 2013-10-07 blaschke-oss parseEXPMETHODRESPONSE has several issues
* 2685 2013-10-07 blaschke-oss Element.getAttribute returns empty string if no attribute
+ * 2686 2013-10-10 blaschke-oss parseEXPPARAMVALUE allows 2+ children, prohibits 0
*/
package org.sblim.cimclient.internal.cimxml;
@@ -2627,16 +2628,22 @@
*/
public static CIMInstance parseEXPPARAMVALUE(Element pExpParamValueE)
throws CIMXMLParseException {
- // <!ELEMENT EXPPARAMVALUE (INSTANCE)>
+ // <!ELEMENT EXPPARAMVALUE (INSTANCE?)>
// <!ATTLIST EXPPARAMVALUE
// %CIMName;>
// INSTANCE
- Element instanceE = (Element) searchFirstNode(pExpParamValueE, "INSTANCE");
- if (instanceE != null) {
- CIMInstance inst = parseINSTANCE(instanceE);
+ Element[] instanceA = searchNodes(pExpParamValueE, "INSTANCE");
+ if (instanceA != null && instanceA.length > 0) {
+ if (instanceA.length > 1) throw new CIMXMLParseException(
+ "EXPPARAMVALUE element must have only one INSTANCE child element!");
+ CIMInstance inst = parseINSTANCE(instanceA[0]);
return inst;
}
- throw new CIMXMLParseException("EXPPARAMVALUE element missing INSTANCE child element!");
+
+ if (hasNodes(pExpParamValueE)) throw new CIMXMLParseException(
+ "EXPPARAMVALUE element contains invalid child element!");
+
+ return null;
}
/**
|