version 1.74, 2002/09/13 21:40:42
|
version 1.81, 2002/11/14 16:50:33
|
|
|
| |
if (!CIMName::legal(name)) | if (!CIMName::legal(name)) |
{ | { |
|
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
// In testing, replace illegal CIMName with this value to avoid the |
|
// exception and let xml parsing continue. THIS IS TEMP. |
|
name = "BADNAMESUBSTITUTEDBYPEGASUSCLIENT"; |
|
#else |
char buffer[MESSAGE_SIZE]; | char buffer[MESSAGE_SIZE]; |
sprintf(buffer, "Illegal value for %s.NAME attribute", elementName); | sprintf(buffer, "Illegal value for %s.NAME attribute", elementName); |
throw XmlSemanticError(lineNumber, buffer); | throw XmlSemanticError(lineNumber, buffer); |
|
#endif |
} | } |
|
|
return CIMName (name); | return CIMName (name); |
} | } |
| |
|
|
if (!entry.getAttributeValue("CLASSORIGIN", name)) | if (!entry.getAttributeValue("CLASSORIGIN", name)) |
return CIMName(); | return CIMName(); |
| |
|
// KS 200209 This may be temp but we are adding test for form |
|
// CLASSNAME = "" for Wbemservices interoperability. Returns same |
|
// as if attribute did not exist. |
|
if (name.size() == 0) |
|
return CIMName(); |
|
|
if (!CIMName::legal(name)) | if (!CIMName::legal(name)) |
{ | { |
char buffer[MESSAGE_SIZE]; | char buffer[MESSAGE_SIZE]; |
|
|
| |
if (!CIMName::legal(name)) | if (!CIMName::legal(name)) |
{ | { |
|
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
name = "PEGASUS_SUBSTITUED_THIS_FOR_BAD_NAME"; |
|
return name; |
|
#endif |
char buffer[MESSAGE_SIZE]; | char buffer[MESSAGE_SIZE]; |
sprintf(buffer, | sprintf(buffer, |
"Illegal value for %s.REFERENCECLASS attribute", elementName); | "Illegal value for %s.REFERENCECLASS attribute", elementName); |
|
|
| |
if (!stringToUnsignedInteger(valueString, x)) | if (!stringToUnsignedInteger(valueString, x)) |
{ | { |
|
char message[128]; |
|
sprintf(message, "Illegal unsigned integer value - %s", valueString); |
throw XmlSemanticError( | throw XmlSemanticError( |
lineNumber, "Invalid unsigned integer value"); |
lineNumber, message); |
} | } |
| |
switch (type) | switch (type) |
|
|
| |
try | try |
{ | { |
|
// KS 20021002 - Exception if no datatime value. Test for |
|
// zero length and leave the NULL value in the variable |
|
// Bugzilla 137 Adds the following if line. |
|
// Expect this to become permanent but test only for now |
|
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
if (strlen(valueString) != 0) |
|
#endif |
tmp.set(valueString); | tmp.set(valueString); |
} | } |
catch (InvalidDateTimeFormatException&) | catch (InvalidDateTimeFormatException&) |
|
|
| |
expectEndTag(parser, "VALUE"); | expectEndTag(parser, "VALUE"); |
} | } |
|
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
// KS 20021004 - tries to put value in even if empty. |
|
// Think this is general problem with empty value |
|
// Need to check meaning of (#PCDATA) - Does it allow empty. |
|
// Bugzilla tbd |
|
if (!empty) |
|
#endif |
value = stringToValue(parser.getLine(), valueString,type); | value = stringToValue(parser.getLine(), valueString,type); |
| |
return true; | return true; |
|
|
| |
if (!testStartTag(parser, entry, "HOST")) | if (!testStartTag(parser, entry, "HOST")) |
return false; | return false; |
|
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
// Temp code to allow empty HOST field. |
|
// SNIA CIMOMs return empty field particularly on enumerateinstance. |
|
// Simply substitute a string for the empty. |
|
if (!parser.next(entry)) |
|
throw XmlException(XmlException::UNCLOSED_TAGS, parser.getLine()); |
|
|
|
if (entry.type == XmlEntry::CONTENT) |
|
host = entry.text; |
|
else |
|
{ |
|
parser.putBack(entry); |
|
host = "HOSTNAMEINSERTEDBYPEGASUSCLIENT"; |
|
} |
|
|
|
#else |
| |
if (!parser.next(entry) || entry.type != XmlEntry::CONTENT) | if (!parser.next(entry) || entry.type != XmlEntry::CONTENT) |
{ | { |
|
|
} | } |
| |
host = entry.text; | host = entry.text; |
|
#endif |
expectEndTag(parser, "HOST"); | expectEndTag(parser, "HOST"); |
return true; | return true; |
} | } |
|
|
else | else |
return false; | return false; |
} | } |
|
|
Boolean empty = entry.type == XmlEntry::EMPTY_TAG; | Boolean empty = entry.type == XmlEntry::EMPTY_TAG; |
| |
className = getCimNameAttribute( | className = getCimNameAttribute( |
parser.getLine(), entry, "CLASSNAME", true); |
parser.getLine(), entry, "CLASSNAME", false); |
| |
if (!empty) | if (!empty) |
expectEndTag(parser, "CLASSNAME"); | expectEndTag(parser, "CLASSNAME"); |