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

Diff for /pegasus/src/Pegasus/Common/XmlParser.cpp between version 1.32 and 1.42

version 1.32, 2005/03/28 17:31:35 version 1.42, 2007/07/30 06:50:57
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 27 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By: David Dillard, VERITAS Software Corp.  
 //                  (david.dillard@veritas.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Line 58 
Line 55 
 //              &apos - apostrophe //              &apos - apostrophe
 // //
 //             as well as character (numeric) references: //             as well as character (numeric) references:
   //
 //              1 - decimal reference for character '1' //              1 - decimal reference for character '1'
 //              1 - hexadecimal reference for character '1' //              1 - hexadecimal reference for character '1'
 // //
Line 81 
Line 78 
 // //
 // TODO: // TODO:
 // //
 //      ATTN: KS P1 4 Mar 2002. Review the following TODOs to see if there is work.  //      ATTN: KS P1 4 Mar 2002. Review the following TODOs to see if there is
 //      Handle <!DOCTYPE...> sections which are complicated (containing  //      work. Handle <!DOCTYPE...> sections which are complicated (containing
 //        rules rather than references to files). //        rules rather than references to files).
 // //
 //      Remove newlines from string literals: //      Remove newlines from string literals:
Line 100 
Line 97 
 #include "XmlParser.h" #include "XmlParser.h"
 #include "Logger.h" #include "Logger.h"
 #include "ExceptionRep.h" #include "ExceptionRep.h"
   #include "CharSet.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 #define PEGASUS_ARRAY_T XmlEntry  
 # include "ArrayImpl.h"  
 #undef PEGASUS_ARRAY_T  
   
   
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 // //
 // Static helper functions // Static helper functions
Line 155 
Line 148 
 // Section 2.3 of XML 1.0 Standard (http://www.w3.org/TR/REC-xml) // Section 2.3 of XML 1.0 Standard (http://www.w3.org/TR/REC-xml)
 // defines white space as: // defines white space as:
 // S    ::=    (#x20 | #x9 | #xD | #xA)+ // S    ::=    (#x20 | #x9 | #xD | #xA)+
 static int _isspace(char c)  static inline int _isspace(char c)
 { {
         if (c == ' ' || c == '\r' || c == '\t' || c == '\n')      return CharSet::isXmlWhiteSpace((Uint8)c);
                 return 1;  
         return 0;  
 } }
  
   
 static Uint32 _REFERENCES_SIZE = (sizeof(_references) / sizeof(_references[0])); static Uint32 _REFERENCES_SIZE = (sizeof(_references) / sizeof(_references[0]));
  
 // Remove all redundant spaces from the given string:  
   
 static void _normalize(char* text)  
 {  
     char* p = text;  
     char* end = p + strlen(text);  
   
     // Remove leading spaces:  
   
     while (_isspace(*p))  
                 p++;  
   
     if (p != text)  
         memmove(text, p, end - p + 1);  
   
     p = text;  
   
     // Look for sequences of more than one space and remove all but one.  
   
     for (;;)  
     {  
         // Advance to the next space:  
   
         while (*p && !_isspace(*p))  
             p++;  
   
         if (!*p)  
             break;  
   
         // Advance to the next non-space:  
   
         char* q = p++;  
   
         while (_isspace(*p))  
             p++;  
   
         // Discard trailing spaces (if we are at the end):  
   
         if (!*p)  
         {  
             *q = '\0';  
             break;  
         }  
   
         // Remove the redundant spaces:  
   
         const size_t n = p - q;  
   
         if (n > 1)  
         {  
             *q++ = ' ';  
             memmove(q, p, end - p + 1);  
             p = q;  
         }  
     }  
 }  
   
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 // //
 // XmlException // XmlException
Line 291 
Line 224 
 } }
 */ */
  
 static MessageLoaderParms _formMessage(Uint32 code, Uint32 line, const String& message)  static MessageLoaderParms _formMessage(
       Uint32 code,
       Uint32 line,
       const String& message)
 { {
     String dftMsg = _xmlMessages[Uint32(code) - 1];     String dftMsg = _xmlMessages[Uint32(code) - 1];
     String key = _xmlKeys[Uint32(code) - 1];     String key = _xmlKeys[Uint32(code) - 1];
Line 353 
Line 289 
     const String& message)     const String& message)
     : XmlException(XmlException::VALIDATION_ERROR, lineNumber, message)     : XmlException(XmlException::VALIDATION_ERROR, lineNumber, message)
 { {
   
 } }
  
  
Line 362 
Line 297 
     MessageLoaderParms& msgParms)     MessageLoaderParms& msgParms)
     : XmlException(XmlException::VALIDATION_ERROR, lineNumber, msgParms)     : XmlException(XmlException::VALIDATION_ERROR, lineNumber, msgParms)
 { {
   
 } }
  
  
Line 377 
Line 311 
     const String& message)     const String& message)
     : XmlException(XmlException::SEMANTIC_ERROR, lineNumber, message)     : XmlException(XmlException::SEMANTIC_ERROR, lineNumber, message)
 { {
   
 } }
  
  
Line 386 
Line 319 
     MessageLoaderParms& msgParms)     MessageLoaderParms& msgParms)
     : XmlException(XmlException::SEMANTIC_ERROR, lineNumber, msgParms)     : XmlException(XmlException::SEMANTIC_ERROR, lineNumber, msgParms)
 { {
   
 } }
  
  
Line 396 
Line 328 
 // //
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
 XmlParser::XmlParser(char* text) : _line(1), _text(text), _current(text),  XmlParser::XmlParser(char* text)
     _restoreChar('\0'), _foundRoot(false)      : _line(1),
         _current(text),
         _restoreChar('\0'),
         _foundRoot(false)
 { {
   }
  
   inline void _skipWhitespace(Uint32& line, char*& p)
   {
       while (*p && _isspace(*p))
       {
           if (*p == '\n')
               line++;
   
           p++;
       }
 } }
  
 Boolean XmlParser::next(XmlEntry& entry)  static int _getEntityRef(char*& p)
   {
       if ((p[0] == 'g') && (p[1] == 't') && (p[2] == ';'))
       {
           p += 3;
           return '>';
       }
   
       if ((p[0] == 'l') && (p[1] == 't') && (p[2] == ';'))
       {
           p += 3;
           return '<';
       }
   
       if ((p[0] == 'a') && (p[1] == 'p') && (p[2] == 'o') && (p[3] == 's') &&
           (p[4] == ';'))
       {
           p += 5;
           return '\'';
       }
   
       if ((p[0] == 'q') && (p[1] == 'u') && (p[2] == 'o') && (p[3] == 't') &&
           (p[4] == ';'))
       {
           p += 5;
           return '"';
       }
   
       if ((p[0] == 'a') && (p[1] == 'm') && (p[2] == 'p') && (p[3] == ';'))
       {
           p += 4;
           return '&';
       }
   
       return -1;
   }
   
   static inline int _getCharRef(char*& p, bool hex)
   {
       char* end;
       unsigned long ch;
   
       if (hex)
       {
           ch = strtoul(p, &end, 16);
       }
       else
       {
           ch = strtoul(p, &end, 10);
       }
   
       if ((end == p) || (*end != ';') || (ch > 255))
       {
           return -1;
       }
   
       if ((hex && (end - p > 4)) || (!hex && (end - p > 5)))
       {
           return -1;
       }
   
       p = end + 1;
   
       return ch;
   }
   
   static void _normalize(Uint32& line, char*& p, char end_char, char*& start)
   {
       // Skip over leading whitespace:
   
       _skipWhitespace(line, p);
       start = p;
   
       // Process one character at a time:
   
       char* q = p;
   
       while (*p && (*p != end_char))
       {
           if (_isspace(*p))
           {
               // Compress sequences of whitespace characters to a single space
               // character. Update line number when newlines encountered.
   
               if (*p++ == '\n')
               {
                   line++;
               }
   
               *q++ = ' ';
   
               _skipWhitespace(line, p);
           }
           else if (*p == '&')
           {
               // Process entity characters and entity references:
   
               p++;
               int ch;
   
               if (*p == '#')
               {
                   *p++;
   
                   if (*p == 'x')
                   {
                       p++;
                       ch = _getCharRef(p, true);
                   }
                   else
                   {
                       ch = _getCharRef(p, false);
                   }
               }
               else
               {
                   ch = _getEntityRef(p);
               }
   
               if (ch == -1)
               {
                   throw XmlException(XmlException::MALFORMED_REFERENCE, line);
               }
   
               *q++ = ch;
           }
           else
           {
               *q++ = *p++;
           }
       }
   
       // We encountered a the end_char or a zero-terminator.
   
       *q = *p;
   
       // Remove single trailing whitespace (consecutive whitespaces already
       // compressed above).  Since p >= q, we can tell if we need to strip a
       // trailing space from q by looking at the end of p.  We must not look at
       // the last character of p, though, if p is an empty string.
   
       if ((p != start) && _isspace(p[-1]))
       {
           q--;
       }
   
       // If q got behind p, it is safe and necessary to null-terminate q
   
       if (q != p)
       {
           *q = '\0';
       }
   }
   
   Boolean XmlParser::next(XmlEntry& entry, Boolean includeComment)
 { {
     if (!_putBackStack.isEmpty())     if (!_putBackStack.isEmpty())
     {     {
Line 424 
Line 523 
         _restoreChar = '\0';         _restoreChar = '\0';
     }     }
  
       // Loop until we are done with comments if includeComment is false.
       do
       {
     // Skip over any whitespace:     // Skip over any whitespace:
           _skipWhitespace(_line, _current);
     _skipWhitespace(_current);  
  
     if (!*_current)     if (!*_current)
     {     {
Line 467 
Line 568 
  
             _stack.pop();             _stack.pop();
         }         }
   
         return true;  
     }     }
     else     else
     {     {
               // Normalize the content:
   
               char* start;
               _normalize(_line, _current, '<', start);
   
               // Get the content:
   
         entry.type = XmlEntry::CONTENT;         entry.type = XmlEntry::CONTENT;
         entry.text = _current;              entry.text = start;
         _getContent(_current);  
               // Overwrite '<' with a null character (temporarily).
   
         _restoreChar = *_current;         _restoreChar = *_current;
         *_current = '\0';         *_current = '\0';
  
         if (nullTerminator)         if (nullTerminator)
             *nullTerminator = '\0';             *nullTerminator = '\0';
           }
         _substituteReferences((char*)entry.text);      }while (!includeComment && entry.type == XmlEntry::COMMENT);
         _normalize((char*)entry.text);  
  
         return true;         return true;
     }     }
 }  
  
 void XmlParser::putBack(XmlEntry& entry) void XmlParser::putBack(XmlEntry& entry)
 { {
Line 498 
Line 604 
     // Nothing to do!     // Nothing to do!
 } }
  
 void XmlParser::_skipWhitespace(char*& p)  // A-Za-z0-9_-:.
 {  static unsigned char _isInnerElementChar[] =
     while (*p && _isspace(*p))  
     {     {
         if (*p == '\n')      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
             _line++;      0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
         p++;      1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     }      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 }      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   };
  
 Boolean XmlParser::_getElementName(char*& p) Boolean XmlParser::_getElementName(char*& p)
 { {
     if (!(((*p >= 'A') && (*p <= 'Z')) ||      if (!CharSet::isAlNumUnder(Uint8(*p)))
           ((*p >= 'a') && (*p <= 'z')) ||  
           (*p == '_')))  
         throw XmlException(XmlException::BAD_START_TAG, _line);         throw XmlException(XmlException::BAD_START_TAG, _line);
   
     p++;     p++;
  
     while ((*p) &&      while (*p && _isInnerElementChar[Uint8(*p)])
            (((*p >= 'A') && (*p <= 'Z')) ||  
             ((*p >= 'a') && (*p <= 'z')) ||  
             ((*p >= '0') && (*p <= '9')) ||  
             *p == '_' || *p == '-' || *p == ':' || *p == '.'))  
         p++;         p++;
  
     // The next character must be a space:     // The next character must be a space:
Line 529 
Line 631 
     if (_isspace(*p))     if (_isspace(*p))
     {     {
         *p++ = '\0';         *p++ = '\0';
         _skipWhitespace(p);          _skipWhitespace(_line, p);
     }     }
  
     if (*p == '>')     if (*p == '>')
Line 545 
Line 647 
 { {
     openCloseElement = false;     openCloseElement = false;
  
     if (!(((*p >= 'A') && (*p <= 'Z')) ||      if (!CharSet::isAlNumUnder(Uint8(*p)))
           ((*p >= 'a') && (*p <= 'z')) ||  
           (*p == '_')))  
         throw XmlException(XmlException::BAD_START_TAG, _line);         throw XmlException(XmlException::BAD_START_TAG, _line);
   
     p++;     p++;
  
     while ((*p) &&      while (*p && _isInnerElementChar[Uint8(*p)])
            (((*p >= 'A') && (*p <= 'Z')) ||  
             ((*p >= 'a') && (*p <= 'z')) ||  
             ((*p >= '0') && (*p <= '9')) ||  
             *p == '_' || *p == '-' || *p == ':' || *p == '.'))  
         p++;         p++;
  
     // The next character must be a space:     // The next character must be a space:
Line 563 
Line 660 
     if (_isspace(*p))     if (_isspace(*p))
     {     {
         *p++ = '\0';         *p++ = '\0';
         _skipWhitespace(p);          _skipWhitespace(_line, p);
     }     }
  
     if (*p == '>')     if (*p == '>')
Line 585 
Line 682 
  
 void XmlParser::_getAttributeNameAndEqual(char*& p) void XmlParser::_getAttributeNameAndEqual(char*& p)
 { {
     if (!(((*p >= 'A') && (*p <= 'Z')) ||      if (!CharSet::isAlNumUnder((Uint8)*p))
           ((*p >= 'a') && (*p <= 'z')) ||  
           (*p == '_')))  
         throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line);         throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line);
   
     p++;     p++;
  
     while ((*p) &&      while (*p && _isInnerElementChar[Uint8(*p)])
            (((*p >= 'A') && (*p <= 'Z')) ||  
             ((*p >= 'a') && (*p <= 'z')) ||  
             ((*p >= '0') && (*p <= '9')) ||  
             *p == '_' || *p == '-' || *p == ':' || *p == '.'))  
         p++;         p++;
  
     char* term = p;     char* term = p;
  
     _skipWhitespace(p);      _skipWhitespace(_line, p);
  
     if (*p != '=')     if (*p != '=')
         throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line);         throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line);
  
     p++;     p++;
  
     _skipWhitespace(p);      _skipWhitespace(_line, p);
  
     *term = '\0';     *term = '\0';
 } }
  
 void XmlParser::_getAttributeValue(char*& p)  
 {  
     // ATTN-B: handle values contained in semiquotes:  
   
     if (*p != '"' && *p != '\'')  
         throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);  
   
     char startChar = *p++;  
   
     while (*p && *p != startChar)  
         p++;  
   
     if (*p != startChar)  
         throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);  
   
     *p++ = '\0';  
 }  
   
 void XmlParser::_getComment(char*& p) void XmlParser::_getComment(char*& p)
 { {
     // Now p points to first non-whitespace character beyond "<--" sequence:     // Now p points to first non-whitespace character beyond "<--" sequence:
Line 694 
Line 768 
     p++;     p++;
 } }
  
 void XmlParser::_getContent(char*& p)  
 {  
     while (*p && *p != '<')  
     {  
         if (*p == '\n')  
             _line++;  
   
         p++;  
     }  
 }  
   
 void XmlParser::_substituteReferences(char* text)  
 {  
     size_t rem = strlen(text);  
   
     for (char* p = text; *p; p++, rem--)  
     {  
         if (*p == '&')  
         {  
             // Process character or entity reference  
   
             Uint16 referenceChar = 0;  
             Uint32 referenceLength = 0;  
             XmlException::Code code = XmlException::MALFORMED_REFERENCE;  
   
             if (*(p+1) == '#')  
             {  
                 // Found a character (numeric) reference  
                 // Determine whether it is decimal or hex  
                 if (*(p+2) == 'x')  
                 {  
                     // Decode a hexadecimal character reference  
                     char* q = p+3;  
   
                     // At most four digits are allowed, plus trailing ';'  
                     Uint32 numDigits;  
                     for (numDigits = 0; numDigits < 5; numDigits++, q++)  
                     {  
                         if (isdigit(*q))  
                         {  
                             referenceChar = (referenceChar << 4);  
                             referenceChar += (*q - '0');  
                         }  
                         else if ((*q >= 'A') && (*q <= 'F'))  
                         {  
                             referenceChar = (referenceChar << 4);  
                             referenceChar += (*q - 'A' + 10);  
                         }  
                         else if ((*q >= 'a') && (*q <= 'f'))  
                         {  
                             referenceChar = (referenceChar << 4);  
                             referenceChar += (*q - 'a' + 10);  
                         }  
                         else if (*q == ';')  
                         {  
                             break;  
                         }  
                         else  
                         {  
                             throw XmlException(code, _line);  
                         }  
                     }  
   
                     // Hex number must be 1 - 4 digits  
                     if ((numDigits == 0) || (numDigits > 4))  
                     {  
                         throw XmlException(code, _line);  
                     }  
   
                     // ATTN: Currently do not support 16-bit characters  
                     if (referenceChar > 0xff)  
                     {  
                         // ATTN: Is there a good way to say "unsupported"?  
                         throw XmlException(code, _line);  
                     }  
   
                     referenceLength = numDigits + 4;  
                 }  
                 else  
                 {  
                     // Decode a decimal character reference  
                     Uint32 newChar = 0;  
                     char* q = p+2;  
   
                     // At most five digits are allowed, plus trailing ';'  
                     Uint32 numDigits;  
                     for (numDigits = 0; numDigits < 6; numDigits++, q++)  
                     {  
                         if (isdigit(*q))  
                         {  
                             newChar = (newChar * 10);  
                             newChar += (*q - '0');  
                         }  
                         else if (*q == ';')  
                         {  
                             break;  
                         }  
                         else  
                         {  
                             throw XmlException(code, _line);  
                         }  
                     }  
   
                     // Decimal number must be 1 - 5 digits and fit in 16 bits  
                     if ((numDigits == 0) || (numDigits > 5) ||  
                         (newChar > 0xffff))  
                     {  
                         throw XmlException(code, _line);  
                     }  
   
                     // ATTN: Currently do not support 16-bit characters  
                     if (newChar > 0xff)  
                     {  
                         // ATTN: Is there a good way to say "unsupported"?  
                         throw XmlException(code, _line);  
                     }  
   
                     referenceChar = Uint16(newChar);  
                     referenceLength = numDigits + 3;  
                 }  
             }  
             else  
             {  
                 // Check for entity reference  
                 // ATTN: Inefficient if many entity references are supported  
                 Uint32 i;  
                 for (i = 0; i < _REFERENCES_SIZE; i++)  
                 {  
                     Uint32 length = _references[i].length;  
                     const char* match = _references[i].match;  
   
                     if (strncmp(p, _references[i].match, length) == 0)  
                     {  
                         referenceChar = _references[i].replacement;  
                         referenceLength = length;  
                         break;  
                     }  
                 }  
   
                 if (i == _REFERENCES_SIZE)  
                 {  
                     // Didn't recognize the entity reference  
                     // ATTN: Is there a good way to say "unsupported"?  
                     throw XmlException(code, _line);  
                 }  
             }  
   
             // Replace the reference with the correct character  
             *p = (char)referenceChar;  
             char* q = p + referenceLength;  
             rem = rem - referenceLength + 1;  
             memmove(p + 1, q, rem);  
         }  
     }  
 }  
   
 static const char _EMPTY_STRING[] = "";  
   
 void XmlParser::_getElement(char*& p, XmlEntry& entry) void XmlParser::_getElement(char*& p, XmlEntry& entry)
 { {
     entry.attributeCount = 0;     entry.attributeCount = 0;
Line 895 
Line 811 
         else if (memcmp(p, "DOCTYPE", 7) == 0)         else if (memcmp(p, "DOCTYPE", 7) == 0)
         {         {
             entry.type = XmlEntry::DOCTYPE;             entry.type = XmlEntry::DOCTYPE;
             entry.text = _EMPTY_STRING;              entry.text = "";
             _getDocType(p);             _getDocType(p);
             return;             return;
         }         }
Line 960 
Line 876 
         attr.name = p;         attr.name = p;
         _getAttributeNameAndEqual(p);         _getAttributeNameAndEqual(p);
  
         if (*p != '"' && *p != '\'')          // Get the attribute value (e.g., "some value")
           {
               if ((*p != '"') && (*p != '\''))
               {
             throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);             throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);
               }
   
               char quote = *p++;
  
         attr.value = p + 1;              char* start;
         _getAttributeValue(p);              _normalize(_line, p, quote, start);
               attr.value = start;
   
               if (*p != quote)
               {
                   throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);
               }
   
               // Overwrite the closing quote with a null-terminator:
   
               *p++ = '\0';
           }
  
         if (entry.type == XmlEntry::XML_DECLARATION)         if (entry.type == XmlEntry::XML_DECLARATION)
         {         {
Line 983 
Line 916 
             throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);             throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);
         }         }
  
         _skipWhitespace(p);          _skipWhitespace(_line, p);
  
         if (entry.attributeCount == XmlEntry::MAX_ATTRIBUTES)         if (entry.attributeCount == XmlEntry::MAX_ATTRIBUTES)
             throw XmlException(XmlException::TOO_MANY_ATTRIBUTES, _line);             throw XmlException(XmlException::TOO_MANY_ATTRIBUTES, _line);
  
         _substituteReferences((char*)attr.value);  
         entry.attributes[entry.attributeCount++] = attr;         entry.attributes[entry.attributeCount++] = attr;
     }     }
 } }
Line 1141 
Line 1073 
     return true;     return true;
 } }
  
 void XmlAppendCString(Array<char>& out, const char* str)  void XmlAppendCString(Buffer& out, const char* str)
 { {
     out.append(str, static_cast<Uint32>(strlen(str)));     out.append(str, static_cast<Uint32>(strlen(str)));
 } }


Legend:
Removed from v.1.32  
changed lines
  Added in v.1.42

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2