(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.131 and 1.144.4.4

version 1.131, 2008/08/12 19:36:13 version 1.144.4.4, 2013/06/03 22:35:14
Line 1 
Line 1 
 //%2006////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development  // Licensed to The Open Group (TOG) under one or more contributor license
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;  // this work for additional information regarding copyright ownership.
 // IBM Corp.; EMC Corporation, The Open Group.  // Each contributor licenses this file to you under the OpenPegasus Open
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;  // Source License; you may not use this file except in compliance with the
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.  // License.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;  //
 // EMC Corporation; VERITAS Software Corporation; The Open Group.  // Permission is hereby granted, free of charge, to any person obtaining a
 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;  // copy of this software and associated documentation files (the "Software"),
 // EMC Corporation; Symantec Corporation; The Open Group.  // to deal in the Software without restriction, including without limitation
 //  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // Permission is hereby granted, free of charge, to any person obtaining a copy  // and/or sell copies of the Software, and to permit persons to whom the
 // of this software and associated documentation files (the "Software"), to  // Software is furnished to do so, subject to the following conditions:
 // deal in the Software without restriction, including without limitation the  //
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // The above copyright notice and this permission notice shall be included
 // sell copies of the Software, and to permit persons to whom the Software is  // in all copies or substantial portions of the Software.
 // furnished to do so, subject to the following conditions:  //
 //  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 // //
 //==============================================================================  //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
Line 40 
Line 38 
 # include <errno.h> # include <errno.h>
 #endif #endif
 #include "CIMName.h" #include "CIMName.h"
   #include "CIMNameCast.h"
 #include "XmlReader.h" #include "XmlReader.h"
 #include "XmlWriter.h" #include "XmlWriter.h"
 #include "CIMQualifier.h" #include "CIMQualifier.h"
Line 54 
Line 53 
 #include <Pegasus/Common/MessageLoader.h> #include <Pegasus/Common/MessageLoader.h>
 #include <Pegasus/Common/StringConversion.h> #include <Pegasus/Common/StringConversion.h>
 #include <Pegasus/Common/AutoPtr.h> #include <Pegasus/Common/AutoPtr.h>
 #include "CIMNameUnchecked.h"  
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 206 
Line 204 
     {     {
         MessageLoaderParms mlParms(         MessageLoaderParms mlParms(
             "Common.XmlReader.EXPECTED_CDATA",             "Common.XmlReader.EXPECTED_CDATA",
             "Expected content of CDATA");              "Expected content or CDATA");
         throw XmlValidationError(parser.getLine(), mlParms);         throw XmlValidationError(parser.getLine(), mlParms);
     }     }
  
Line 267 
Line 265 
     XmlEntry& entry,     XmlEntry& entry,
     const char* tagName)     const char* tagName)
 { {
     if (!parser.next(entry) ||      if (!parser.next(entry))
        (entry.type != XmlEntry::START_TAG &&      {
           return false;
       }
       if ((entry.type != XmlEntry::START_TAG &&
         entry.type != XmlEntry::EMPTY_TAG) ||         entry.type != XmlEntry::EMPTY_TAG) ||
         strcmp(entry.text, tagName) != 0)         strcmp(entry.text, tagName) != 0)
     {     {
Line 371 
Line 372 
     const char* elementName,     const char* elementName,
     Boolean acceptNull)     Boolean acceptNull)
 { {
     String name;      const char* name;
  
     if (!entry.getAttributeValue("NAME", name))     if (!entry.getAttributeValue("NAME", name))
     {     {
Line 385 
Line 386 
         throw XmlValidationError(lineNumber, mlParms);         throw XmlValidationError(lineNumber, mlParms);
     }     }
  
     if (acceptNull && name.size() == 0)      if (acceptNull && *name == '\0')
         return CIMName ();         return CIMName ();
  
     if (!CIMName::legal(name))      Uint32 size = CIMNameLegalASCII(name);
   
       if (size)
     {     {
 #ifdef PEGASUS_SNIA_INTEROP_TEST          String tmp(name, size);
     // In testing, replace illegal CIMName with this value to avoid the          return CIMName(CIMNameCast(tmp));
     // exception and let xml parsing continue.  THIS IS TEMP.      }
     name = "BADNAMESUBSTITUTEDBYPEGASUSCLIENT";  
 #else  
  
       if (!CIMName::legal(name))
       {
     char buffer[MESSAGE_SIZE];     char buffer[MESSAGE_SIZE];
     sprintf(buffer, "%s.NAME", elementName);     sprintf(buffer, "%s.NAME", elementName);
  
Line 405 
Line 408 
         buffer);         buffer);
  
     throw XmlSemanticError(lineNumber, mlParms);     throw XmlSemanticError(lineNumber, mlParms);
   
 #endif  
     }     }
     return CIMNameUnchecked(name);  
       return CIMNameCast(name);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 472 
Line 474 
     if (!entry.getAttributeValue("CLASSORIGIN", name))     if (!entry.getAttributeValue("CLASSORIGIN", name))
         return CIMName();         return CIMName();
  
       /* Interoperability hack to make the C++ client of OpenPegasus able
          to deal with the wbemservices CIMOM delivered with Sun Solaris.
          The issue is that the wbemservices delivers Xml responses with
          CLASSORIGIN=""
          Originally this had been reported with Bug#537.
       */
       if (name.size()==0)
       {
           return CIMName();
       }
   
     if (!CIMName::legal(name))     if (!CIMName::legal(name))
     {     {
         char buffer[MESSAGE_SIZE];         char buffer[MESSAGE_SIZE];
Line 484 
Line 497 
         throw XmlSemanticError(lineNumber, mlParms);         throw XmlSemanticError(lineNumber, mlParms);
     }     }
     // The CIMName was already checked with legal() + String()     // The CIMName was already checked with legal() + String()
     return CIMNameUnchecked(name);      return CIMNameCast(name);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 559 
Line 572 
  
     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, "%s.REFERENCECLASS", elementName);         sprintf(buffer, "%s.REFERENCECLASS", elementName);
  
Line 574 
Line 582 
         throw XmlSemanticError(lineNumber, mlParms);         throw XmlSemanticError(lineNumber, mlParms);
     }     }
     // The CIMName was already checked with legal() + String()     // The CIMName was already checked with legal() + String()
     return CIMNameUnchecked(name);      return CIMNameCast(name);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 607 
Line 615 
         throw XmlSemanticError(lineNumber, mlParms);         throw XmlSemanticError(lineNumber, mlParms);
     }     }
     // The CIMName was already checked with legal() + String()     // The CIMName was already checked with legal() + String()
     return CIMNameUnchecked(superClass);      return CIMNameCast(superClass);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 772 
Line 780 
 { {
     Uint32 i;     Uint32 i;
  
     Array<Uint8> utf8Chars;      Buffer utf8Chars;
  
     for (i=0; i<uriString.size(); i++)     for (i=0; i<uriString.size(); i++)
     {     {
Line 799 
Line 807 
             }             }
  
             Uint16 decodedChar = Uint16(digit1<<4) + Uint16(digit2);             Uint16 decodedChar = Uint16(digit1<<4) + Uint16(digit2);
             utf8Chars.append((Uint8)decodedChar);              utf8Chars.append((char)decodedChar);
         }         }
         else         else
         {         {
             utf8Chars.append((Uint8)uriString[i]);              utf8Chars.append((char)uriString[i]);
         }         }
     }     }
  
Line 811 
Line 819 
     if (uriString.size() > 0)     if (uriString.size() > 0)
     {     {
         // Convert UTF-8 to UTF-16 and return the String         // Convert UTF-8 to UTF-16 and return the String
         utf8Chars.append('\0');          return String(utf8Chars.getData(), utf8Chars.size());
         return String((char *)utf8Chars.getData());  
     }     }
     else     else
     {     {
Line 822 
Line 829 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // stringToSignedInteger  
 //  
 //      [ "+" | "-" ] ( positiveDecimalDigit *decimalDigit | "0" )  
 //    or  
 //      [ "+" | "-" ] ( "0x" | "0X" ) 1*hexDigit  
 //  
 //------------------------------------------------------------------------------  
   
 Boolean XmlReader::stringToSignedInteger(  
     const char* stringValue,  
     Sint64& x)  
 {  
     return (StringConversion::stringToSint64(  
                 stringValue, StringConversion::decimalStringToUint64, x) ||  
             StringConversion::stringToSint64(  
                 stringValue, StringConversion::hexStringToUint64, x));  
 }  
   
 //------------------------------------------------------------------------------  
 //  
 // stringToUnsignedInteger  
 //  
 //      ( positiveDecimalDigit *decimalDigit | "0" )  
 //    or  
 //      ( "0x" | "0X" ) 1*hexDigit  
 //  
 //------------------------------------------------------------------------------  
   
 Boolean XmlReader::stringToUnsignedInteger(  
     const char* stringValue,  
     Uint64& x)  
 {  
     return (StringConversion::decimalStringToUint64(stringValue, x) ||  
             StringConversion::hexStringToUint64(stringValue, x));  
 }  
   
 //------------------------------------------------------------------------------  
 //  
 // stringToValue() // stringToValue()
 // //
 // Return: CIMValue. If the string input is zero length creates a CIMValue // Return: CIMValue. If the string input is zero length creates a CIMValue
Line 874 
Line 843 
     const char* valueString,     const char* valueString,
     CIMType type)     CIMType type)
 { {
       return stringToValue(lineNumber, valueString, strlen(valueString), type);
   }
   
   CIMValue XmlReader::stringToValue(
       Uint32 lineNumber,
       const char* valueString,
       Uint32 valueStringLen,
       CIMType type)
   {
     // ATTN-B: accepting only UTF-8 for now! (affects string and char16):     // ATTN-B: accepting only UTF-8 for now! (affects string and char16):
  
       // Char string must have been null terminated.
       PEGASUS_ASSERT (!valueString[valueStringLen]);
   
     // Create value per type     // Create value per type
     switch (type)     switch (type)
     {     {
Line 896 
Line 877 
  
         case CIMTYPE_STRING:         case CIMTYPE_STRING:
         {         {
             return CIMValue(String(valueString));              return CIMValue(String(valueString, valueStringLen));
         }         }
  
         case CIMTYPE_CHAR16:         case CIMTYPE_CHAR16:
         {         {
             // Converts UTF-8 to UTF-16             // Converts UTF-8 to UTF-16
             String tmp(valueString);              String tmp(valueString, valueStringLen);
             if (tmp.size() != 1)             if (tmp.size() != 1)
             {             {
                 MessageLoaderParms mlParms(                 MessageLoaderParms mlParms(
Line 921 
Line 902 
         {         {
             Uint64 x;             Uint64 x;
  
             if (!stringToUnsignedInteger(valueString, x))              if (!StringConversion::stringToUnsignedInteger(valueString, x))
             {             {
                 MessageLoaderParms mlParms(                 MessageLoaderParms mlParms(
                     "Common.XmlReader.INVALID_UI_VALUE",                     "Common.XmlReader.INVALID_UI_VALUE",
Line 976 
Line 957 
         {         {
             Sint64 x;             Sint64 x;
  
             if (!stringToSignedInteger(valueString, x))              if (!StringConversion::stringToSignedInteger(valueString, x))
             {             {
                 MessageLoaderParms mlParms(                 MessageLoaderParms mlParms(
                     "Common.XmlReader.INVALID_SI_VALUE",                     "Common.XmlReader.INVALID_SI_VALUE",
Line 1030 
Line 1011 
  
             try             try
             {             {
                 // KS 20021002 - Exception if no datetime value. Test for                  if (valueStringLen != 0)
                 // 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&)
             {             {
                 MessageLoaderParms mlParms(                 MessageLoaderParms mlParms(
Line 1083 
Line 1060 
 //  just a Pegasus internal representation of an embedded object. However, //  just a Pegasus internal representation of an embedded object. However,
 //  this case is used when decoding string representations of embedded objects. //  this case is used when decoding string representations of embedded objects.
         case CIMTYPE_OBJECT:         case CIMTYPE_OBJECT:
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         case CIMTYPE_INSTANCE:         case CIMTYPE_INSTANCE:
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         {         {
             CIMObject x;             CIMObject x;
  
Line 1102 
Line 1077 
                 // just the value of the Embedded Object in String                 // just the value of the Embedded Object in String
                 // representation.                 // representation.
                 AutoArrayPtr<char> tmp_buffer(                 AutoArrayPtr<char> tmp_buffer(
                     new char[strlen(valueString) + 1]);                      new char[valueStringLen + 1]);
                 strcpy(tmp_buffer.get(), valueString);                  memcpy(tmp_buffer.get(), valueString, valueStringLen + 1);
                 XmlParser tmp_parser(tmp_buffer.get());                 XmlParser tmp_parser(tmp_buffer.get());
  
                 // The next bit of logic constructs a CIMObject from the                 // The next bit of logic constructs a CIMObject from the
Line 1114 
Line 1089 
  
                 if (XmlReader::getInstanceElement(tmp_parser, cimInstance))                 if (XmlReader::getInstanceElement(tmp_parser, cimInstance))
                 {                 {
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
                     if (type == CIMTYPE_INSTANCE)                     if (type == CIMTYPE_INSTANCE)
                         return CIMValue(cimInstance);                         return CIMValue(cimInstance);
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
                     x = CIMObject(cimInstance);                     x = CIMObject(cimInstance);
                 }                 }
                 else if (XmlReader::getClassElement(tmp_parser, cimClass))                 else if (XmlReader::getClassElement(tmp_parser, cimClass))
Line 1126 
Line 1099 
                 }                 }
                 else                 else
                 {                 {
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
                     if (type == CIMTYPE_OBJECT)                     if (type == CIMTYPE_OBJECT)
                     {                     {
                         // change "element" to "embedded object"                         // change "element" to "embedded object"
Line 1144 
Line 1116 
                             "Expected INSTANCE element");                             "Expected INSTANCE element");
                         throw XmlValidationError(lineNumber, mlParms);                         throw XmlValidationError(lineNumber, mlParms);
                     }                     }
 #else  
                     // change "element" to "embedded object"  
                     MessageLoaderParms mlParms(  
                         "Common.XmlReader.EXPECTED_INSTANCE_OR_CLASS_ELEMENT",  
                         "Expected INSTANCE or CLASS element");  
                     throw XmlValidationError(lineNumber, mlParms);  
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
                 }                 }
                 // Ok, now we can delete the storage for the temporary                 // Ok, now we can delete the storage for the temporary
                 // XmlParser.                 // XmlParser.
Line 1227 
Line 1192 
     Boolean empty = entry.type == XmlEntry::EMPTY_TAG;     Boolean empty = entry.type == XmlEntry::EMPTY_TAG;
  
     const char* valueString = "";     const char* valueString = "";
       Uint32 valueStringLen = 0;
     if (!empty)     if (!empty)
     {     {
         if (testContentOrCData(parser, entry))         if (testContentOrCData(parser, entry))
         {         {
             valueString = entry.text;             valueString = entry.text;
               valueStringLen = entry.textLen;
         }         }
  
         expectEndTag(parser, "VALUE");         expectEndTag(parser, "VALUE");
     }     }
 #ifdef PEGASUS_SNIA_INTEROP_TEST      value = stringToValue(parser.getLine(),valueString,valueStringLen,type);
     // 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);  
  
     return true;     return true;
 } }
Line 1279 
Line 1238 
     Boolean empty = entry.type == XmlEntry::EMPTY_TAG;     Boolean empty = entry.type == XmlEntry::EMPTY_TAG;
  
     const char* valueString = "";     const char* valueString = "";
       Uint32 valueStringLen = 0;
  
     if (!empty)     if (!empty)
     {     {
         if (testContentOrCData(parser, entry))         if (testContentOrCData(parser, entry))
           {
             valueString = entry.text;             valueString = entry.text;
               valueStringLen = entry.textLen;
           }
  
         expectEndTag(parser, "VALUE");         expectEndTag(parser, "VALUE");
     }     }
  
     str = String(valueString);      str = String(valueString, valueStringLen);
     return true;     return true;
 } }
  
   // EXP_PULL_BEGIN
   //------------------------------------------------------------------------------
   //
   // getUint32ArgValueElement()
   //
   //     <!ELEMENT VALUE (#PCDATA)>
   //
   //------------------------------------------------------------------------------
   
   Boolean XmlReader::getUint32ArgValueElement(
       XmlParser& parser,
       Uint32Arg& val,
       Boolean required)
   {
       XmlEntry entry;
   
       if (!testStartTagOrEmptyTag(parser, entry, "VALUE"))
       {
           if (required)
           {
               MessageLoaderParms mlParms(
                   "Common.XmlReader.EXPECTED_VALUE_ELEMENT",
                   "Expected VALUE element");
               throw XmlValidationError(parser.getLine(), mlParms);
           }
           return false;
       }
   
       Boolean empty = entry.type == XmlEntry::EMPTY_TAG;
   
       const char* valueString = "";
   
       if (!empty)
       {
           if (testContentOrCData(parser, entry))
               valueString = entry.text;
   
           expectEndTag(parser, "VALUE");
       }
       else
       {
           // create the arg object with the NULL value in it.
           val = Uint32Arg();
           return true;
       }
   
       //convert to Uint32. Note error if overflow.
   
       Uint64 x;
       if (!StringConversion::stringToUnsignedInteger(valueString, x))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.INVALID_UI_VALUE",
               "Invalid unsigned integer value");
           throw XmlSemanticError(parser.getLine(), mlParms);
       }
   
       if (!StringConversion::checkUintBounds(x, CIMTYPE_UINT32))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.U32_VALUE_OUT_OF_RANGE",
               "Uint32 value out of range");
           throw XmlSemanticError(parser.getLine(), mlParms);
       }
       // create the arg object with the value in it.
       val = Uint32Arg(x);
   
       return true;
   }
   //------------------------------------------------------------------------------
   //
   // getUint64ValueElement()
   //
   //     <!ELEMENT VALUE (#PCDATA)>
   //
   //------------------------------------------------------------------------------
   
   Boolean XmlReader::getUint64ValueElement(
       XmlParser& parser,
       Uint64Arg& val,
       Boolean required)
   {
       XmlEntry entry;
   
       if (!testStartTagOrEmptyTag(parser, entry, "VALUE"))
       {
           if (required)
           {
               MessageLoaderParms mlParms(
                   "Common.XmlReader.EXPECTED_VALUE_ELEMENT",
                   "Expected VALUE element");
               throw XmlValidationError(parser.getLine(), mlParms);
           }
           return false;
       }
   
       Boolean empty = entry.type == XmlEntry::EMPTY_TAG;
   
       const char* valueString = "";
   
       if (!empty)
       {
           if (testContentOrCData(parser, entry))
               valueString = entry.text;
   
           expectEndTag(parser, "VALUE");
       }
       else
       {
           // create the arg object with the NULL value in it.
           val = Uint64Arg();
           return true;
       }
   
       Uint64 x;
       // EXP_PULL clean this up KS_TODO
       if (!StringConversion::stringToUnsignedInteger(valueString, x))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.INVALID_UI_VALUE",
               "Invalid unsigned integer value");
           throw XmlSemanticError(parser.getLine(), mlParms);
       }
       //EXP_PULL_QUESTION- Is there even a check for 64 bit too large
   
       if (!StringConversion::checkUintBounds(x, CIMTYPE_UINT64))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.U64_VALUE_OUT_OF_RANGE",
               "Uint64 value out of range");
           throw XmlSemanticError(parser.getLine(), mlParms);
       }
       // create the arg object with the value in it.
       val = Uint64Arg(x);
   
       return true;
   }
   
   
   //------------------------------------------------------------------------------
   //
   // getUint32ValueElement()
   //
   //     <!ELEMENT VALUE (#PCDATA)>
   //
   //------------------------------------------------------------------------------
   
   Boolean XmlReader::getUint32ValueElement(
       XmlParser& parser,
       Uint32& val,
       Boolean required)
   {
       XmlEntry entry;
   
       if (!testStartTagOrEmptyTag(parser, entry, "VALUE"))
       {
           if (required)
           {
               MessageLoaderParms mlParms(
                   "Common.XmlReader.EXPECTED_VALUE_ELEMENT",
                   "Expected VALUE element");
               throw XmlValidationError(parser.getLine(), mlParms);
           }
           return false;
       }
   
       Boolean empty = entry.type == XmlEntry::EMPTY_TAG;
   
       const char* valueString = "";
   
       if (!empty)
       {
           if (testContentOrCData(parser, entry))
               valueString = entry.text;
   
           expectEndTag(parser, "VALUE");
       }
       else
       {
           // leave the existing value
           return true;
       }
   
       //convert to Uint32. Note error if overflow.
   
       Uint64 x;
       if (!StringConversion::stringToUnsignedInteger(valueString, x))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.INVALID_UI_VALUE",
               "Invalid unsigned integer value");
           throw XmlSemanticError(parser.getLine(), mlParms);
       }
   
       if (!StringConversion::checkUintBounds(x, CIMTYPE_UINT32))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.U32_VALUE_OUT_OF_RANGE",
               "Uint32 value out of range");
           throw XmlSemanticError(parser.getLine(), mlParms);
       }
       // create the arg object with the value in it.
       val = x;
   
       return true;
   }
   //EXP_PULL_END
   
 //---------------------------------------------------------------------------- //----------------------------------------------------------------------------
 // //
 // getPropertyValue // getPropertyValue
Line 1357 
Line 1528 
 template<class T> template<class T>
 CIMValue StringArrayToValueAux( CIMValue StringArrayToValueAux(
     Uint32 lineNumber,     Uint32 lineNumber,
     const Array<const char*>& stringArray,      const Array<CharString>& stringArray,
     CIMType type,     CIMType type,
     T*)     T*)
 { {
Line 1366 
Line 1537 
     for (Uint32 i = 0, n = stringArray.size(); i < n; i++)     for (Uint32 i = 0, n = stringArray.size(); i < n; i++)
     {     {
         CIMValue value = XmlReader::stringToValue(         CIMValue value = XmlReader::stringToValue(
             lineNumber, stringArray[i], type);              lineNumber,
               stringArray[i].value,
               stringArray[i].length,
               type);
  
         T x;         T x;
         value.get(x);         value.get(x);
Line 1381 
Line 1555 
     const Array<const char*>& array,     const Array<const char*>& array,
     CIMType type)     CIMType type)
 { {
       Array<CharString> strArray;
   
       for (Uint32 i = 0, n = array.size() ; i < n ; ++i)
       {
           strArray.append(CharString(array[i], strlen(array[i])));
       }
   
       return _stringArrayToValue(lineNumber, strArray, type);
   }
   
   CIMValue XmlReader::_stringArrayToValue(
       Uint32 lineNumber,
       const Array<CharString> &array,
       CIMType type)
   {
     switch (type)     switch (type)
     {     {
         case CIMTYPE_BOOLEAN:         case CIMTYPE_BOOLEAN:
Line 1433 
Line 1622 
         case CIMTYPE_OBJECT:         case CIMTYPE_OBJECT:
             return StringArrayToValueAux(             return StringArrayToValueAux(
                 lineNumber, array, type, (CIMObject*)0);                 lineNumber, array, type, (CIMObject*)0);
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         case CIMTYPE_INSTANCE:         case CIMTYPE_INSTANCE:
             return StringArrayToValueAux(             return StringArrayToValueAux(
                 lineNumber, array, type, (CIMInstance*)0);                 lineNumber, array, type, (CIMInstance*)0);
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
   
         default:         default:
             break;             break;
     }     }
Line 1468 
Line 1654 
     // Get VALUE.ARRAY open tag:     // Get VALUE.ARRAY open tag:
  
     XmlEntry entry;     XmlEntry entry;
     Array<const char*> stringArray;      Array<CharString> stringArray;
  
     // If no VALUE.ARRAY start tag, return false     // If no VALUE.ARRAY start tag, return false
     if (!testStartTagOrEmptyTag(parser, entry, "VALUE.ARRAY"))     if (!testStartTagOrEmptyTag(parser, entry, "VALUE.ARRAY"))
Line 1480 
Line 1666 
  
         while (testStartTagOrEmptyTag(parser, entry, "VALUE"))         while (testStartTagOrEmptyTag(parser, entry, "VALUE"))
         {         {
               // ATTN: NULL values in array will have VALUE.NULL subelement
               // See DSP0201 Version 2.3.0, Section 5.2.3.2
             if (entry.type == XmlEntry::EMPTY_TAG)             if (entry.type == XmlEntry::EMPTY_TAG)
             {             {
                 stringArray.append("");                  stringArray.append(CharString("", 0));
                 continue;                 continue;
             }             }
  
             if (testContentOrCData(parser, entry))             if (testContentOrCData(parser, entry))
                 stringArray.append(entry.text);              {
                   stringArray.append(CharString(entry.text, entry.textLen));
               }
             else             else
                 stringArray.append("");              {
                   stringArray.append(CharString("", 0));
               }
             expectEndTag(parser, "VALUE");             expectEndTag(parser, "VALUE");
         }         }
  
         expectEndTag(parser, "VALUE.ARRAY");         expectEndTag(parser, "VALUE.ARRAY");
     }     }
  
     value = stringArrayToValue(parser.getLine(), stringArray, type);      value = _stringArrayToValue(parser.getLine(), stringArray, type);
     return true;     return true;
 } }
  
Line 1791 
Line 1982 
     {     {
         property.getQualifier(ix).getValue().get(embeddedObjectQualifierValue);         property.getQualifier(ix).getValue().get(embeddedObjectQualifierValue);
     }     }
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     String embeddedInstanceQualifierValue;     String embeddedInstanceQualifierValue;
     ix = property.findQualifier(PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE);     ix = property.findQualifier(PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE);
     if (ix != PEG_NOT_FOUND)     if (ix != PEG_NOT_FOUND)
Line 1799 
Line 1989 
         property.getQualifier(ix).getValue().get(         property.getQualifier(ix).getValue().get(
             embeddedInstanceQualifierValue);             embeddedInstanceQualifierValue);
     }     }
 #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  
     Boolean isEmbeddedObject = (embeddedObject == EMBEDDED_OBJECT_ATTR) ||     Boolean isEmbeddedObject = (embeddedObject == EMBEDDED_OBJECT_ATTR) ||
         embeddedObjectQualifierValue;         embeddedObjectQualifierValue;
     Boolean isEmbeddedInstance = (embeddedObject == EMBEDDED_INSTANCE_ATTR) ||     Boolean isEmbeddedInstance = (embeddedObject == EMBEDDED_INSTANCE_ATTR) ||
Line 1844 
Line 2032 
             throw XmlValidationError(parser.getLine(), mlParms);             throw XmlValidationError(parser.getLine(), mlParms);
         }         }
     }     }
 #else  
     if ((embeddedObject == EMBEDDED_OBJECT_ATTR)|| embeddedObjectQualifierValue)  
     {  
         // The EmbeddedObject attribute is only valid on Properties of type  
         // string  
         if (type == CIMTYPE_STRING)  
         {  
             type = CIMTYPE_OBJECT;  
             CIMValue new_value(type, false);  
             CIMProperty new_property = CIMProperty(  
                 name, new_value, 0, CIMName(), classOrigin, propagated);  
   
             // Copy the qualifiers from the String property to the CIMObject  
             // property.  
             for (Uint32 i = 0; i < property.getQualifierCount(); ++i)  
             {  
                 // All properties are copied, including the EmbeddedObject  
                 // qualifier.  This way we don't have to keep track to know  
                 // that the EmbeddedObject qualifier needs to be added back  
                 // during the encode step.  
                 new_property.addQualifier(property.getQualifier(i));  
             }  
   
             value = new_value;  
             property = new_property;  
         }  
         else  
         {  
             MessageLoaderParms mlParms(  
                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",  
                 "The EmbeddedObject attribute is only valid on string types.");  
             throw XmlValidationError(parser.getLine(), mlParms);  
         }  
     }  
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     // Continue on to get property value, if not empty.     // Continue on to get property value, if not empty.
     if (!empty)     if (!empty)
     {     {
Line 1914 
Line 2067 
  
     Uint64 arraySize;     Uint64 arraySize;
  
     if (!stringToUnsignedInteger(tmp, arraySize) || (arraySize == 0) ||      if (!StringConversion::stringToUnsignedInteger(tmp, arraySize) ||
           (arraySize == 0) ||
         !StringConversion::checkUintBounds(arraySize, CIMTYPE_UINT32))         !StringConversion::checkUintBounds(arraySize, CIMTYPE_UINT32))
     {     {
         char message[128];         char message[128];
Line 2012 
Line 2166 
     {     {
         property.getQualifier(ix).getValue().get(embeddedObjectQualifierValue);         property.getQualifier(ix).getValue().get(embeddedObjectQualifierValue);
     }     }
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     String embeddedInstanceQualifierValue;     String embeddedInstanceQualifierValue;
     ix = property.findQualifier(PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE);     ix = property.findQualifier(PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE);
     if (ix != PEG_NOT_FOUND)     if (ix != PEG_NOT_FOUND)
Line 2020 
Line 2173 
         property.getQualifier(ix).getValue().get(         property.getQualifier(ix).getValue().get(
             embeddedInstanceQualifierValue);             embeddedInstanceQualifierValue);
     }     }
 #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
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     Boolean isEmbeddedObject = (embeddedObject == EMBEDDED_OBJECT_ATTR) ||     Boolean isEmbeddedObject = (embeddedObject == EMBEDDED_OBJECT_ATTR) ||
         embeddedObjectQualifierValue;         embeddedObjectQualifierValue;
     Boolean isEmbeddedInstance = (embeddedObject == EMBEDDED_INSTANCE_ATTR) ||     Boolean isEmbeddedInstance = (embeddedObject == EMBEDDED_INSTANCE_ATTR) ||
Line 2066 
Line 2217 
             throw XmlValidationError(parser.getLine(), mlParms);             throw XmlValidationError(parser.getLine(), mlParms);
         }         }
     }     }
 #else  
     if ((embeddedObject == EMBEDDED_OBJECT_ATTR)||embeddedObjectQualifierValue)  
     {  
         // The EmbeddedObject attribute is only valid on Properties of type  
         // string  
         if (type == CIMTYPE_STRING)  
         {  
             type = CIMTYPE_OBJECT;  
             CIMValue new_value(type, true, arraySize);  
             CIMProperty new_property = CIMProperty(  
                 name, new_value, arraySize, CIMName(), classOrigin, propagated);  
   
             // Copy the qualifiers from the String property to the CIMObject  
             // property.  
             for (Uint32 i = 0; i < property.getQualifierCount(); ++i)  
             {  
                 // All properties are copied, including the EmbeddedObject  
                 // qualifier.  This way we don't have to keep track to know  
                 // that the EmbeddedObject qualifier needs to be added back  
                 // during the encode step.  
                 new_property.addQualifier(property.getQualifier(i));  
             }  
   
             value = new_value;  
             property = new_property;  
         }  
         else  
         {  
             MessageLoaderParms mlParms(  
                 "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",  
                 "The EmbeddedObject attribute is only valid on string types.");  
             throw XmlValidationError(parser.getLine(), mlParms);  
         }  
     }  
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     // Continue on to get property array value, if not empty.     // Continue on to get property array value, if not empty.
     // Else not an embedded object, if not empty, get the property array value.     // Else not an embedded object, if not empty, get the property array value.
     if (!empty)     if (!empty)
Line 2139 
Line 2255 
  
     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 = String(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)
     {     {
Line 2165 
Line 2265 
     }     }
  
     host = String(entry.text);     host = String(entry.text);
 #endif  
     expectEndTag(parser, "HOST");     expectEndTag(parser, "HOST");
     return true;     return true;
 } }
Line 2498 
Line 2597 
     else     else
     {     {
         while (getKeyBindingElement(parser, name, value, type))         while (getKeyBindingElement(parser, name, value, type))
           {
             keyBindings.append(CIMKeyBinding(name, value, type));             keyBindings.append(CIMKeyBinding(name, value, type));
               if (keyBindings.size() > PEGASUS_MAXELEMENTS_NUM)
               {
                   MessageLoaderParms mlParms(
                       "Common.XmlReader.TOO_MANY_KEYBINDINGS",
                       "More than $0 key-value pairs per object path"
                           " are not supported.",
                       PEGASUS_MAXELEMENTS_NUM);
                   throw XmlValidationError(parser.getLine(), mlParms);
               }
           }
     }     }
  
     expectEndTag(parser, "INSTANCENAME");     expectEndTag(parser, "INSTANCENAME");
Line 2706 
Line 2816 
 // //
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
   //
   // Parses the input to a CIMObjectPath.  Note that today the differences
   // between ClassPath and InstancePath are lost in this mapping because
   // Pegasus uses the existence of keys as separator . See BUG_3302
 Boolean XmlReader::getValueReferenceElement( Boolean XmlReader::getValueReferenceElement(
     XmlParser& parser,     XmlParser& parser,
     CIMObjectPath& reference)     CIMObjectPath& reference)
Line 3173 
Line 3286 
     // Get ARRAYSIZE attribute:     // Get ARRAYSIZE attribute:
  
     Uint32 arraySize = 0;     Uint32 arraySize = 0;
     Boolean gotArraySize = getArraySizeAttribute(parser.getLine(),      getArraySizeAttribute(parser.getLine(),
         entry, "QUALIFIER.DECLARATION", arraySize);         entry, "QUALIFIER.DECLARATION", arraySize);
  
     // Get flavor oriented attributes:     // Get flavor oriented attributes:
Line 3432 
Line 3545 
     return true;     return true;
 } }
  
   
   //EXP_PULL_BEGIN
   //------------------------------------------------------------------------------
   // getInstanceWithPathElement()
   //
   //     <!ELEMENT VALUE.NAMEDINSTANCE (INSTANCENAME,INSTANCE)>
   //
   //------------------------------------------------------------------------------
   
   Boolean XmlReader::getInstanceWithPathElement(
       XmlParser& parser,
       CIMInstance& namedInstance)
   {
       XmlEntry entry;
       if (!testStartTag(parser, entry, "VALUE.INSTANCEWITHPATH"))
           return false;
   
       CIMObjectPath instanceName;
   
       // Get INSTANCENAME elements:
   //EXP_PULL_ISSUE Should we have new getInstancePathElement??? KS_TODO
       if (!getInstancePathElement(parser, instanceName))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.EXPECTED_INSTANCEPATH_ELEMENT",
               "expected INSTANCEPATH element");
           throw XmlValidationError(parser.getLine(), mlParms);
       }
   
       // Get INSTANCE elements:
   
       if (!getInstanceElement(parser, namedInstance))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.EXPECTED_INSTANCE_ELEMENT",
               "expected INSTANCE element");
           throw XmlValidationError(parser.getLine(), mlParms);
       }
       // Get VALUE.NAMEDINSTANCE end tag:
   
       expectEndTag(parser, "VALUE.INSTANCEWITHPATH");
   
       namedInstance.setPath (instanceName);
   
       return true;
   }
   
   //EXP_PULL_END
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // getObject() // getObject()
Line 3616 
Line 3778 
     return true;     return true;
 } }
  
   //EXP_PULL_BEGIN
   //------------------------------------------------------------------------------
   //
   // getIParamValueTag()
   //
   //------------------------------------------------------------------------------
   
   Boolean XmlReader::getParamValueTag(
       XmlParser& parser,
       const char*& name,
       Boolean& isEmptyTag)
   {
       XmlEntry entry;
   
       if (!testStartTagOrEmptyTag(parser, entry, "PARAMVALUE"))
       {
   
           return false;
       }
   
       isEmptyTag = (entry.type == XmlEntry::EMPTY_TAG);
   
       // Get PARAMVALUE.NAME attribute:
   
       if (!entry.getAttributeValue("NAME", name))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.MISSING_PARAMVALUE_ATTRIBUTE",
               "Missing PARAMVALUE.NAME attribute");
           throw XmlValidationError(parser.getLine(), mlParms);
       }
       return true;
   }
   //------------------------------------------------------------------------------
   //
   // getIReturnValueTag()
   //
   //------------------------------------------------------------------------------
   ////EXP_PULL Think we can get rid of this KS_TODO
   Boolean XmlReader::getIReturnValueTag(
       XmlParser& parser,
       const char*& name,
       Boolean& isEmptyTag)
   {
       XmlEntry entry;
       if (!testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
           return false;
       //entry.print();
       isEmptyTag = (entry.type == XmlEntry::EMPTY_TAG);
   
       if (!entry.getAttributeValue("NAME", name))
       {
           MessageLoaderParms mlParms(
               "Common.XmlReader.MISSING_IRETURNVALUE_ATTRIBUTE",
               "Missing IRETURNVALUE.NAME attribute");
           throw XmlValidationError(parser.getLine(), mlParms);
       }
   // EXP_PULL_TBD Add new msg above to msg bundle.  KS_TODO
       return true;
   }
   
   //EXP_PULL_END
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // rejectNullIParamValue() // rejectNullIParamValue()
Line 3636 
Line 3860 
     }     }
 } }
  
   // EXP_PULL_BEGIN
   //------------------------------------------------------------------------------
   //
   // rejectNullIReturnParamValue()
   //
   //------------------------------------------------------------------------------
   
   void XmlReader::rejectNullIReturnValue(
       XmlParser& parser,
       Boolean isEmptyTag,
       const char* paramName)
   {
       if (isEmptyTag)
       {
           MessageLoaderParms mlParms("Common.XmlReader.INVALID_NULL_IRETURNVALUE",
               "A null value is not valid for IRETURNVALUE \"$0\".",
               paramName);
           throw XmlValidationError(parser.getLine(), mlParms);
       }
   }
   
   void XmlReader::rejectNullParamValue(
       XmlParser& parser,
       Boolean isEmptyTag,
       const char* paramName)
   {
       if (isEmptyTag)
       {
           MessageLoaderParms mlParms("Common.XmlReader.INVALID_NULL_PARAMVALUE",
               "A null value is not valid for PARAMVALUE \"$0\".",
               paramName);
           throw XmlValidationError(parser.getLine(), mlParms);
       }
   }
   // EXP_PULL_TODO_TBD add above message to bundle KS_TODO
   // EXP_PULL_END
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // getBooleanValueElement() // getBooleanValueElement()
Line 3960 
Line 4220 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
   // Returns true if ClassNameElement or false if InstanceNameElement
   // Parse errors always throw exception
 Boolean XmlReader::getObjectNameElement( Boolean XmlReader::getObjectNameElement(
     XmlParser& parser,     XmlParser& parser,
     CIMObjectPath& objectName)     CIMObjectPath& objectName)
Line 3969 
Line 4231 
     if (getClassNameElement(parser, className, false))     if (getClassNameElement(parser, className, false))
     {     {
         objectName.set(String(), CIMNamespaceName(), className);         objectName.set(String(), CIMNamespaceName(), className);
   
           // Return flag indicating this is ClassNameElement
         return true;         return true;
     }     }
  
Line 3980 
Line 4244 
         throw XmlValidationError(parser.getLine(), mlParms);         throw XmlValidationError(parser.getLine(), mlParms);
     }     }
  
     return true;      // Return flag indicating this is InstanceNameElement
       return false;
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 4255 
Line 4520 
             // 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  
             if (embeddedObject != NO_EMBEDDED_OBJECT)             if (embeddedObject != NO_EMBEDDED_OBJECT)
             {             {
                 // The EmbeddedObject attribute is only valid on Parameters                 // The EmbeddedObject attribute is only valid on Parameters
Line 4279 
Line 4543 
                     throw XmlValidationError(parser.getLine(), mlParms);                     throw XmlValidationError(parser.getLine(), mlParms);
                 }                 }
             }             }
 #else  
             if (embeddedObject == EMBEDDED_OBJECT_ATTR)  
             {  
                 // The EmbeddedObject attribute is only valid on Parameters  
                 // of type string  
                 // The type must have been specified.  
                 if (gotType && (type == CIMTYPE_STRING))  
                 {  
                     // Used below by getValueElement() or getValueArrayElement()  
                     effectiveType = CIMTYPE_OBJECT;  
                 }  
                 else  
                 {  
                     MessageLoaderParms mlParms(  
                         "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",  
                         "The EmbeddedObject attribute is only valid on "  
                             "string types.");  
                     throw XmlValidationError(parser.getLine(), mlParms);  
                 }  
             }  
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
  
             if (!XmlReader::getValueArrayElement(parser, effectiveType, value)             if (!XmlReader::getValueArrayElement(parser, effectiveType, value)
                 && !XmlReader::getValueElement(parser, effectiveType, value))                 && !XmlReader::getValueElement(parser, effectiveType, value))
Line 4377 
Line 4620 
             // If we don't know what type the value is, read it as a String             // If we don't know what type the value is, read it as a String
             type = CIMTYPE_STRING;             type = CIMTYPE_STRING;
         }         }
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         if (embeddedObject != NO_EMBEDDED_OBJECT)         if (embeddedObject != NO_EMBEDDED_OBJECT)
         {         {
             if (gotType && (type == CIMTYPE_STRING))             if (gotType && (type == CIMTYPE_STRING))
Line 4397 
Line 4639 
                 throw XmlValidationError(parser.getLine(), mlParms);                 throw XmlValidationError(parser.getLine(), mlParms);
             }             }
         }         }
 #else  
         if (embeddedObject == EMBEDDED_OBJECT_ATTR)  
         {  
             if (gotType && (type == CIMTYPE_STRING))  
             {  
                 type = CIMTYPE_OBJECT;  // Used below by getValueElement()  
             }  
             else  
             {  
                 MessageLoaderParms mlParms(  
                     "Common.XmlReader.INVALID_EMBEDDEDOBJECT_TYPE",  
                     "The EmbeddedObject attribute is only valid on string "  
                         "types.");  
                 throw XmlValidationError(parser.getLine(), mlParms);  
             }  
         }  
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         if ( !XmlReader::getValueElement(parser, type, returnValue) )         if ( !XmlReader::getValueElement(parser, type, returnValue) )
         {         {
             MessageLoaderParms mlParms(             MessageLoaderParms mlParms(


Legend:
Removed from v.1.131  
changed lines
  Added in v.1.144.4.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2