(file) Return to XmlReader.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/XmlReader.cpp between version 1.122.4.3 and 1.123

version 1.122.4.3, 2008/02/11 16:52:12 version 1.123, 2007/03/15 00:24:04
Line 495 
Line 495 
 // //
 // getEmbeddedObjectAttribute() // getEmbeddedObjectAttribute()
 // //
 //     <!ENTITY % EmbeddedObject "EmbeddedObject (object | instance) #IMPLIED">  //     <!ENTITY % EmbeddedObject "EMBEDDEDOBJECT (object | instance) #IMPLIED">
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
Line 506 
Line 506 
 { {
     String embeddedObject;     String embeddedObject;
  
     // Check for both upper case and mixed case "EmbeddedObject"      if (!entry.getAttributeValue("EMBEDDEDOBJECT", embeddedObject))
     // because of an error in an earlier pegasus version  where we  
     // used upper case in the generation of the attribute name  
     // whereas the DMTF spec calls for mixed case.  
     if (!entry.getAttributeValue("EmbeddedObject", embeddedObject) &&  
         !entry.getAttributeValue("EMBEDDEDOBJECT", embeddedObject))  
         return String();         return String();
  
     // The embeddedObject attribute, if present, must have the string     // The embeddedObject attribute, if present, must have the string
Line 520 
Line 515 
           String::equal(embeddedObject, "instance")))           String::equal(embeddedObject, "instance")))
     {     {
         char buffer[MESSAGE_SIZE];         char buffer[MESSAGE_SIZE];
         sprintf(buffer, "%s.EmbeddedObject", elementName);          sprintf(buffer, "%s.EMBEDDEDOBJECT", elementName);
  
         MessageLoaderParms mlParms(         MessageLoaderParms mlParms(
             "Common.XmlReader.ILLEGAL_VALUE_FOR_ATTRIBUTE",             "Common.XmlReader.ILLEGAL_VALUE_FOR_ATTRIBUTE",
Line 2047 
Line 2042 
     Boolean propagated = getCimBooleanAttribute(     Boolean propagated = getCimBooleanAttribute(
         parser.getLine(), entry, "PROPERTY", "PROPAGATED", false, false);         parser.getLine(), entry, "PROPERTY", "PROPAGATED", false, false);
  
     // Get PROPERTY.EmbeddedObject attribute:      // Get PROPERTY.EMBEDDEDOBJECT attribute:
  
     String embeddedObject = getEmbeddedObjectAttribute(     String embeddedObject = getEmbeddedObjectAttribute(
         parser.getLine(), entry, "PROPERTY");         parser.getLine(), entry, "PROPERTY");
Line 2085 
Line 2080 
             embeddedInstanceQualifierValue);             embeddedInstanceQualifierValue);
     }     }
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
     // If the EmbeddedObject attribute is present with value "object"      // If the EMBEDDEDOBJECT attribute is present with value "object"
     // or the EmbeddedObject qualifier exists on this property with value "true"     // or the EmbeddedObject qualifier exists on this property with value "true"
     // then convert the EmbeddedObject-encoded string into a CIMObject      // then
       //     Convert the EmbeddedObject-encoded string into a CIMObject
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
     Boolean isEmbeddedObject = String::equal(embeddedObject, "object") ||     Boolean isEmbeddedObject = String::equal(embeddedObject, "object") ||
         embeddedObjectQualifierValue;         embeddedObjectQualifierValue;
Line 2095 
Line 2091 
         embeddedInstanceQualifierValue.size() > 0;         embeddedInstanceQualifierValue.size() > 0;
     if (isEmbeddedObject || isEmbeddedInstance)     if (isEmbeddedObject || isEmbeddedInstance)
     {     {
         // The EmbeddedObject attribute is only valid on Properties of type          // The EMBEDDEDOBJECT attribute is only valid on Properties of type
         // string         // string
         if (type == CIMTYPE_STRING)         if (type == CIMTYPE_STRING)
         {         {
Line 2125 
Line 2121 
         {         {
             MessageLoaderParms mlParms(             MessageLoaderParms mlParms(
                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                 "The EmbeddedObject attribute is only valid on string types.");                  "The EMBEDDEDOBJECT attribute is only valid on string types.");
             throw XmlValidationError(parser.getLine(), mlParms);             throw XmlValidationError(parser.getLine(), mlParms);
         }         }
     }     }
 #else #else
     if (String::equal(embeddedObject, "object") || embeddedObjectQualifierValue)     if (String::equal(embeddedObject, "object") || embeddedObjectQualifierValue)
     {     {
         // The EmbeddedObject attribute is only valid on Properties of type          // The EMBEDDEDOBJECT attribute is only valid on Properties of type
         // string         // string
         if (type == CIMTYPE_STRING)         if (type == CIMTYPE_STRING)
         {         {
Line 2159 
Line 2155 
         {         {
             MessageLoaderParms mlParms(             MessageLoaderParms mlParms(
                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                 "The EmbeddedObject attribute is only valid on string types.");                  "The EMBEDDEDOBJECT attribute is only valid on string types.");
             throw XmlValidationError(parser.getLine(), mlParms);             throw XmlValidationError(parser.getLine(), mlParms);
         }         }
     }     }
Line 2273 
Line 2269 
         false,         false,
         false);         false);
  
     // Get PROPERTY.EmbeddedObject attribute:      // Get PROPERTY.EMBEDDEDOBJECT attribute:
  
     String embeddedObject = getEmbeddedObjectAttribute(     String embeddedObject = getEmbeddedObjectAttribute(
         parser.getLine(), entry, "PROPERTY.ARRAY");         parser.getLine(), entry, "PROPERTY.ARRAY");
Line 2305 
Line 2301 
             embeddedInstanceQualifierValue);             embeddedInstanceQualifierValue);
     }     }
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
     // If the EmbeddedObject attribute is present with value "object"      // If the EMBEDDEDOBJECT attribute is present with value "object"
     // or the EmbeddedObject qualifier exists on this property with value "true"     // or the EmbeddedObject qualifier exists on this property with value "true"
     // then     // then
     //     Convert the EmbeddedObject-encoded string into a CIMObject     //     Convert the EmbeddedObject-encoded string into a CIMObject
Line 2316 
Line 2312 
         embeddedInstanceQualifierValue.size() > 0;         embeddedInstanceQualifierValue.size() > 0;
     if (isEmbeddedObject || isEmbeddedInstance)     if (isEmbeddedObject || isEmbeddedInstance)
     {     {
         // The EmbeddedObject attribute is only valid on Properties of type          // The EMBEDDEDOBJECT attribute is only valid on Properties of type
         // string         // string
         if (type == CIMTYPE_STRING)         if (type == CIMTYPE_STRING)
         {         {
Line 2346 
Line 2342 
         {         {
             MessageLoaderParms mlParms(             MessageLoaderParms mlParms(
                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                 "The EmbeddedObject attribute is only valid on string types.");                  "The EMBEDDEDOBJECT attribute is only valid on string types.");
             throw XmlValidationError(parser.getLine(), mlParms);             throw XmlValidationError(parser.getLine(), mlParms);
         }         }
     }     }
 #else #else
     if (String::equal(embeddedObject, "object") || embeddedObjectQualifierValue)     if (String::equal(embeddedObject, "object") || embeddedObjectQualifierValue)
     {     {
         // The EmbeddedObject attribute is only valid on Properties of type          // The EMBEDDEDOBJECT attribute is only valid on Properties of type
         // string         // string
         if (type == CIMTYPE_STRING)         if (type == CIMTYPE_STRING)
         {         {
Line 2380 
Line 2376 
         {         {
             MessageLoaderParms mlParms(             MessageLoaderParms mlParms(
                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                 "The EmbeddedObject attribute is only valid on string types.");                  "The EMBEDDEDOBJECT attribute is only valid on string types.");
             throw XmlValidationError(parser.getLine(), mlParms);             throw XmlValidationError(parser.getLine(), mlParms);
         }         }
     }     }
Line 4494 
Line 4490 
         throw XmlValidationError(parser.getLine(), mlParms);         throw XmlValidationError(parser.getLine(), mlParms);
     }     }
  
     // Get PROPERTY.EmbeddedObject      // Get PROPERTY.EMBEDDEDOBJECT
  
     String embeddedObject = getEmbeddedObjectAttribute(     String embeddedObject = getEmbeddedObjectAttribute(
         parser.getLine(), entry, "PARAMVALUE");         parser.getLine(), entry, "PARAMVALUE");
Line 4525 
Line 4521 
                 type = CIMTYPE_REFERENCE;                 type = CIMTYPE_REFERENCE;
                 gotType = true;                 gotType = true;
             }             }
             else              // If type==reference but no VALUE.REFERENCE found, use null value
             {  
                 gotType = false; // Can't distinguish array and non-array types  
             }  
         }         }
  
         // Parse non-reference value         // Parse non-reference value
Line 4545 
Line 4538 
                 effectiveType = type;                 effectiveType = type;
             }             }
  
             // If the EmbeddedObject attribute is present with value "object"              // If the EMBEDDEDOBJECT attribute is present with value "object"
             // then             // then
             //     Convert the EmbeddedObject-encoded string into a CIMObject             //     Convert the EmbeddedObject-encoded string into a CIMObject
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
Line 4554 
Line 4547 
                 String::equal(embeddedObject, "instance");                 String::equal(embeddedObject, "instance");
             if (isEmbeddedObject || isEmbeddedInstance)             if (isEmbeddedObject || isEmbeddedInstance)
             {             {
                 // The EmbeddedObject attribute is only valid on Parameters                  // The EMBEDDEDOBJECT attribute is only valid on Parameters
                 // of type string                 // of type string
                 // The type must have been specified.                 // The type must have been specified.
                 if (gotType && (type == CIMTYPE_STRING))                 if (gotType && (type == CIMTYPE_STRING))
Line 4570 
Line 4563 
                 {                 {
                     MessageLoaderParms mlParms(                     MessageLoaderParms mlParms(
                         "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                         "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                         "The EmbeddedObject attribute is only valid on "                          "The EMBEDDEDOBJECT attribute is only valid on "
                             "string types.");                             "string types.");
                     throw XmlValidationError(parser.getLine(), mlParms);                     throw XmlValidationError(parser.getLine(), mlParms);
                 }                 }
Line 4578 
Line 4571 
 #else #else
             if (String::equal(embeddedObject, "object"))             if (String::equal(embeddedObject, "object"))
             {             {
                 // The EmbeddedObject attribute is only valid on Parameters                  // The EMBEDDEDOBJECT attribute is only valid on Parameters
                 // of type string                 // of type string
                 // The type must have been specified.                 // The type must have been specified.
                 if (gotType && (type == CIMTYPE_STRING))                 if (gotType && (type == CIMTYPE_STRING))
Line 4590 
Line 4583 
                 {                 {
                     MessageLoaderParms mlParms(                     MessageLoaderParms mlParms(
                         "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                         "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                         "The EmbeddedObject attribute is only valid on "                          "The EMBEDDEDOBJECT attribute is only valid on "
                             "string types.");                             "string types.");
                     throw XmlValidationError(parser.getLine(), mlParms);                     throw XmlValidationError(parser.getLine(), mlParms);
                 }                 }
Line 4635 
Line 4628 
     if (!testStartTag(parser, entry, "RETURNVALUE"))     if (!testStartTag(parser, entry, "RETURNVALUE"))
         return false;         return false;
  
     // Get PROPERTY.EmbeddedObject      // Get PROPERTY.EMBEDDEDOBJECT
  
     String embeddedObject = getEmbeddedObjectAttribute(     String embeddedObject = getEmbeddedObjectAttribute(
         parser.getLine(), entry, "RETURNVALUE");         parser.getLine(), entry, "RETURNVALUE");
Line 4690 
Line 4683 
             {             {
                 MessageLoaderParms mlParms(                 MessageLoaderParms mlParms(
                     "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                     "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                     "The EmbeddedObject attribute is only valid on string "                      "The EMBEDDEDOBJECT attribute is only valid on string "
                         "types.");                         "types.");
                 throw XmlValidationError(parser.getLine(), mlParms);                 throw XmlValidationError(parser.getLine(), mlParms);
             }             }
Line 4706 
Line 4699 
             {             {
                 MessageLoaderParms mlParms(                 MessageLoaderParms mlParms(
                     "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",                     "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",
                     "The EmbeddedObject attribute is only valid on string "                      "The EMBEDDEDOBJECT attribute is only valid on string "
                         "types.");                         "types.");
                 throw XmlValidationError(parser.getLine(), mlParms);                 throw XmlValidationError(parser.getLine(), mlParms);
             }             }


Legend:
Removed from v.1.122.4.3  
changed lines
  Added in v.1.123

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2