From kwaclaw at users.sourceforge.net Tue Dec 14 18:24:18 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Tue Dec 14 18:24:23 2004 Subject: [Expat-checkins] htdocs index.html,1.54,1.55 Message-ID: Update of /cvsroot/expat/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19446 Modified Files: index.html Log Message: Official name of SAX.NET changed to SAX for .NET. Index: index.html =================================================================== RCS file: /cvsroot/expat/htdocs/index.html,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- index.html 29 Nov 2004 21:52:14 -0000 1.54 +++ index.html 14 Dec 2004 17:24:15 -0000 1.55 @@ -210,7 +210,7 @@ SAXExpat.NET, a .NET wrapper for Expat, conforming to the - SAX.NET specifications. + SAX for .NET specifications.
  • The Simple C Expat Wrapper is a wrapper around Expat that provides a light-weight object model From kwaclaw at users.sourceforge.net Tue Dec 14 18:26:21 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Tue Dec 14 18:26:23 2004 Subject: [Expat-checkins] expat/doc reference.html,1.62,1.63 Message-ID: Update of /cvsroot/expat/expat/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20019 Modified Files: reference.html Log Message: Small link fix. Index: reference.html =================================================================== RCS file: /cvsroot/expat/expat/doc/reference.html,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- reference.html 26 Nov 2004 00:18:15 -0000 1.62 +++ reference.html 14 Dec 2004 17:26:18 -0000 1.63 @@ -419,7 +419,7 @@ void *) to data with further internal structure. In order to free the memory associated with this object you must call XML_ParserFree. Note that if you have -provided any user data that gets stored in the +provided any user data that gets stored in the parser, then your application is responsible for freeing it prior to calling XML_ParserFree.

    @@ -596,7 +596,7 @@ and unprefixed element names are only expanded when they are in the scope of a default namespace.

    -

    However if However if XML_SetReturnNSTriplet has been called with a non-zero do_nst parameter, then the expanded form for names with an explicit prefix is a concatenation of: URI, separator, local name, From kwaclaw at users.sourceforge.net Fri Dec 17 19:08:26 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Fri Dec 17 19:08:28 2004 Subject: [Expat-checkins] expat Makefile.in,1.47,1.48 Message-ID: Update of /cvsroot/expat/expat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2862 Modified Files: Makefile.in Log Message: Applied the DESTDIR patch provided by Enrico Weigelt. This is a modified form of the patches included with Patch # 779334 and Bug # 985235. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- Makefile.in 24 Sep 2004 15:19:11 -0000 1.47 +++ Makefile.in 17 Dec 2004 18:08:08 -0000 1.48 @@ -44,6 +44,9 @@ APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h LIBRARY = libexpat.la +ifndef INSTALL_ROOT +INSTALL_ROOT=$(DESTDIR) +endif default: buildlib xmlwf/xmlwf @@ -73,22 +76,22 @@ tests/runtests install: xmlwf/xmlwf installlib - $(mkinstalldirs) $(bindir) $(man1dir) - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(bindir)/xmlwf - $(INSTALL_DATA) $(MANFILE) $(man1dir) + $(mkinstalldirs) $(INSTALL_ROOT)$(bindir) $(INSTALL_ROOT)$(man1dir) + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(INSTALL_ROOT)$(bindir)/xmlwf + $(INSTALL_DATA) $(MANFILE) $(INSTALL_ROOT)$(man1dir) installlib: $(LIBRARY) $(APIHEADER) - $(mkinstalldirs) $(libdir) $(includedir) - $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY) - for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(includedir) ; done + $(mkinstalldirs) $(INSTALL_ROOT)$(libdir) $(INSTALL_ROOT)$(includedir) + $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(INSTALL_ROOT)$(libdir)/$(LIBRARY) + for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(INSTALL_ROOT)$(includedir) ; done uninstall: uninstalllib - $(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf - rm -f $(man1dir)/xmlwf.1 + $(LIBTOOL) --mode=uninstall rm -f $(INSTALL_ROOT)$(bindir)/xmlwf + rm -f $(INSTALL_ROOT)$(man1dir)/xmlwf.1 uninstalllib: - $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY) - rm -f $(includedir)/$(APIHEADER) + $(LIBTOOL) --mode=uninstall rm -f $(INSTALL_ROOT)$(libdir)/$(LIBRARY) + rm -f $(INSTALL_ROOT)$(includedir)/$(APIHEADER) # for VPATH builds (invoked by configure) mkdir-init: From kwaclaw at users.sourceforge.net Mon Dec 20 04:19:12 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Mon Dec 20 04:19:15 2004 Subject: [Expat-checkins] expat/lib expat.h,1.73,1.74 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30555 Modified Files: expat.h Log Message: Fixed comment for XML_ParserCreateNS. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- expat.h 26 Nov 2004 00:20:21 -0000 1.73 +++ expat.h 20 Dec 2004 03:19:09 -0000 1.74 @@ -209,8 +209,8 @@ URI, the namespace separator character, and the local part of the name. If the namespace separator is '\0' then the namespace URI and the local part will be concatenated without any separator. - When a namespace is not declared, the name and prefix will be - passed through without expansion. + It is a programming error to use the separator '\0' with namespace + triplets (see XML_SetReturnNSTriplet). */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); From kwaclaw at users.sourceforge.net Mon Dec 20 04:23:32 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Mon Dec 20 04:23:34 2004 Subject: [Expat-checkins] expat/doc reference.html,1.63,1.64 Message-ID: Update of /cvsroot/expat/expat/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31335 Modified Files: reference.html Log Message: Improved and corrected namespace processing documentation. Index: reference.html =================================================================== RCS file: /cvsroot/expat/expat/doc/reference.html,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- reference.html 14 Dec 2004 17:26:18 -0000 1.63 +++ reference.html 20 Dec 2004 03:23:29 -0000 1.64 @@ -591,8 +591,8 @@ separator character (which is the 2nd argument to XML_ParserCreateNS), and the local name (i.e. the part after the colon). Names with undeclared prefixes -are passed through to the handlers unchanged, with the prefix and -colon still attached. Unprefixed attribute names are never expanded, +are not well-formed when namespace processing is enabled, and will +trigger an error. Unprefixed attribute names are never expanded, and unprefixed element names are only expanded when they are in the scope of a default namespace.

    @@ -908,7 +908,11 @@ expanded element names and attribute names are returned as a concatenation of the namespace URI, sep, and the local part of the name. This means that you should pick a character for sep that can't be -part of a legal URI. +part of a legal URI. There is a special case when sep is the null +character '\0': the namespace URI and the local part will be +concatenated without any separator - this is intended to support RDF processors. +It is a programming error to use the null separator with +namespace triplets.
     XML_Parser XMLCALL
    
    From kwaclaw at users.sourceforge.net  Mon Dec 20 06:04:47 2004
    From: kwaclaw at users.sourceforge.net (Karl Waclawek)
    Date: Mon Dec 20 06:04:51 2004
    Subject: [Expat-checkins] expat/lib xmlparse.c,1.138,1.139
    Message-ID: 
    
    Update of /cvsroot/expat/expat/lib
    In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16051
    
    Modified Files:
    	xmlparse.c 
    Log Message:
    Made it consistent that in the case of namespace triplets, the namespace
    separator between local name and prefix is always present, even when
    it is omitted between uri and local name.
    
    Index: xmlparse.c
    ===================================================================
    RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
    retrieving revision 1.138
    retrieving revision 1.139
    diff -u -d -r1.138 -r1.139
    --- xmlparse.c	26 Nov 2004 15:16:17 -0000	1.138
    +++ xmlparse.c	20 Dec 2004 05:04:41 -0000	1.139
    @@ -2822,7 +2822,7 @@
                 }
                 if (!step)
                   step = PROBE_STEP(uriHash, mask, nsAttsPower);
    -            j < step ? ( j += nsAttsSize - step) : (j -= step);
    +            j < step ? (j += nsAttsSize - step) : (j -= step);
               }
             }
     
    @@ -2879,14 +2879,14 @@
       prefixLen = 0;
       if (ns_triplets && binding->prefix->name) {
         for (; binding->prefix->name[prefixLen++];)
    -      ;
    +      ;  /* prefixLen includes null terminator */
       }
       tagNamePtr->localPart = localPart;
       tagNamePtr->uriLen = binding->uriLen;
       tagNamePtr->prefix = binding->prefix->name;
       tagNamePtr->prefixLen = prefixLen;
       for (i = 0; localPart[i++];)
    -    ;
    +    ;  /* i includes null terminator */
       n = i + binding->uriLen + prefixLen;
       if (n > binding->uriAlloc) {
         TAG *p;
    @@ -2901,12 +2901,13 @@
         FREE(binding->uri);
         binding->uri = uri;
       }
    +  /* if namespaceSeparator != '\0' then uri includes it already */
       uri = binding->uri + binding->uriLen;
       memcpy(uri, localPart, i * sizeof(XML_Char));
    +  /* we always have a namespace separator between localPart and prefix */
       if (prefixLen) {
    -    uri = uri + (i - 1);
    -    if (namespaceSeparator)
    -      *uri = namespaceSeparator;
    +    uri += i - 1;
    +    *uri = namespaceSeparator;  /* replace null terminator */
         memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char));
       }
       tagNamePtr->str = binding->uri;
    @@ -5286,7 +5287,7 @@
         if (!poolAppendChar(&tempPool, XML_T('=')))
           return NULL;
         len = dtd->defaultPrefix.binding->uriLen;
    -    if (namespaceSeparator != XML_T('\0'))
    +    if (namespaceSeparator)
           len--;
         for (i = 0; i < len; i++)
           if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
    @@ -5312,7 +5313,7 @@
         if (!poolAppendChar(&tempPool, XML_T('=')))
           return NULL;
         len = prefix->binding->uriLen;
    -    if (namespaceSeparator != XML_T('\0'))
    +    if (namespaceSeparator)
           len--;
         for (i = 0; i < len; i++)
           if (!poolAppendChar(&tempPool, prefix->binding->uri[i]))
    
    From kwaclaw at users.sourceforge.net  Tue Dec 21 19:31:11 2004
    From: kwaclaw at users.sourceforge.net (Karl Waclawek)
    Date: Tue Dec 21 19:31:15 2004
    Subject: [Expat-checkins] expat/lib xmlparse.c,1.139,1.140
    Message-ID: 
    
    Update of /cvsroot/expat/expat/lib
    In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11717
    
    Modified Files:
    	xmlparse.c 
    Log Message:
    Improved error message - see bug # 972802.
    
    Index: xmlparse.c
    ===================================================================
    RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
    retrieving revision 1.139
    retrieving revision 1.140
    diff -u -d -r1.139 -r1.140
    --- xmlparse.c	20 Dec 2004 05:04:41 -0000	1.139
    +++ xmlparse.c	21 Dec 2004 18:30:52 -0000	1.140
    @@ -1854,7 +1854,7 @@
         XML_L("reference to invalid character number"),
         XML_L("reference to binary entity"),
         XML_L("reference to external entity in attribute"),
    -    XML_L("xml declaration not at start of external entity"),
    +    XML_L("XML or text declaration not at start of entity"),
         XML_L("unknown encoding"),
         XML_L("encoding specified in XML declaration is incorrect"),
         XML_L("unclosed CDATA section"),
    
    From kwaclaw at users.sourceforge.net  Fri Dec 24 17:30:35 2004
    From: kwaclaw at users.sourceforge.net (Karl Waclawek)
    Date: Fri Dec 24 17:30:38 2004
    Subject: [Expat-checkins] expat/lib xmlparse.c,1.140,1.141
    Message-ID: 
    
    Update of /cvsroot/expat/expat/lib
    In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32236
    
    Modified Files:
    	xmlparse.c 
    Log Message:
    Fix for bug # 1090885: Problem with Suspend/Resume mechanism.
    The code path through XML_Parse() when XML_CONTEXT_BYTES
    was not defined, did not take into account that XML_ResumParser()
    uses bufferPtr and parseEndPtr as the pointers into the working buffer.
    
    Index: xmlparse.c
    ===================================================================
    RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
    retrieving revision 1.140
    retrieving revision 1.141
    diff -u -d -r1.140 -r1.141
    --- xmlparse.c	21 Dec 2004 18:30:52 -0000	1.140
    +++ xmlparse.c	24 Dec 2004 16:30:25 -0000	1.141
    @@ -1441,7 +1441,7 @@
     
         /* If data are left over from last buffer, and we now know that these
            data are the final chunk of input, then we have to check them again
    -       to detect errors based on this information.
    +       to detect errors based on that fact.
         */
         errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
     
    @@ -1495,7 +1495,6 @@
         }
     
         XmlUpdatePosition(encoding, positionPtr, end, &position);
    -    positionPtr = end;
         nLeftOver = s + len - end;
         if (nLeftOver) {
           if (buffer == NULL || nLeftOver > bufferLim - buffer) {
    @@ -1518,9 +1517,13 @@
             bufferLim = buffer + len * 2;
           }
           memcpy(buffer, end, nLeftOver);
    -      bufferPtr = buffer;
    -      bufferEnd = buffer + nLeftOver;
         }
    +    bufferPtr = buffer;
    +    bufferEnd = buffer + nLeftOver;
    +    positionPtr = bufferPtr;
    +    parseEndPtr = bufferEnd;
    +    eventPtr = bufferPtr;
    +    eventEndPtr = bufferPtr;
         return result;
       }
     #endif  /* not defined XML_CONTEXT_BYTES */
    
    From kwaclaw at users.sourceforge.net  Fri Dec 24 19:00:31 2004
    From: kwaclaw at users.sourceforge.net (Karl Waclawek)
    Date: Fri Dec 24 19:00:34 2004
    Subject: [Expat-checkins] expat/lib expat.h, 1.74, 1.75 xmlparse.c, 1.141,
    	1.142
    Message-ID: 
    
    Update of /cvsroot/expat/expat/lib
    In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16464
    
    Modified Files:
    	expat.h xmlparse.c 
    Log Message:
    Fix for bug # 695407: Reserved prefixes and namespace names.
    Contributed by Peter van der Beken.
    
    Index: expat.h
    ===================================================================
    RCS file: /cvsroot/expat/expat/lib/expat.h,v
    retrieving revision 1.74
    retrieving revision 1.75
    diff -u -d -r1.74 -r1.75
    --- expat.h	20 Dec 2004 03:19:09 -0000	1.74
    +++ expat.h	24 Dec 2004 18:00:28 -0000	1.75
    @@ -91,7 +91,11 @@
       XML_ERROR_NOT_SUSPENDED,
       XML_ERROR_ABORTED,
       XML_ERROR_FINISHED,
    -  XML_ERROR_SUSPEND_PE
    +  XML_ERROR_SUSPEND_PE,
    +  /* Added in 2.0. */
    +  XML_ERROR_RESERVED_PREFIX_XML,
    +  XML_ERROR_RESERVED_PREFIX_XMLNS,
    +  XML_ERROR_RESERVED_NAMESPACE_URI
     };
     
     enum XML_Content_Type {
    
    Index: xmlparse.c
    ===================================================================
    RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
    retrieving revision 1.141
    retrieving revision 1.142
    diff -u -d -r1.141 -r1.142
    --- xmlparse.c	24 Dec 2004 16:30:25 -0000	1.141
    +++ xmlparse.c	24 Dec 2004 18:00:28 -0000	1.142
    @@ -1877,7 +1877,10 @@
         XML_L("parser not suspended"),
         XML_L("parsing aborted"),
         XML_L("parsing finished"),
    -    XML_L("cannot suspend in external parameter entity")
    +    XML_L("cannot suspend in external parameter entity"),
    +    XML_L("reserved prefix (xml) must not be undeclared or bound to another namespace name"),
    +    XML_L("reserved prefix (xmlns) must not be declared or undeclared"),
    +    XML_L("prefix must not be bound to one of the reserved namespace names")
       };
       if (code > 0 && code < sizeof(message)/sizeof(message[0]))
         return message[code];
    @@ -2931,8 +2934,64 @@
       if (*uri == XML_T('\0') && prefix->name)
         return XML_ERROR_UNDECLARING_PREFIX;
     
    -  for (len = 0; uri[len]; len++)
    -    ;
    +  if (ns) {
    +    static const XML_Char xmlNamespace[] = {
    +      'h', 't', 't', 'p', ':', '/', '/',
    +      'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/',
    +      'X', 'M', 'L', '/', '1', '9', '9', '8', '/',
    +      'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0'
    +    };
    +    static const int xmlLen = 
    +      (int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1;
    +    static const XML_Char xmlnsNamespace[] = {
    +      'h', 't', 't', 'p', ':', '/', '/',
    +      'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/',
    +      '2', '0', '0', '0', '/', 'x', 'm', 'l', 'n', 's', '/', '\0'
    +    };
    +    static const int xmlnsLen = 
    +      (int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1;
    +
    +    XML_Bool mustBeXML = XML_FALSE;
    +    XML_Bool isXML = XML_TRUE;
    +    XML_Bool isXMLNS = XML_TRUE;
    +
    +    if (prefix->name
    +        && prefix->name[0] == XML_T('x')
    +        && prefix->name[1] == XML_T('m')
    +        && prefix->name[2] == XML_T('l')) {
    +
    +      /* Not allowed to bind xmlns */
    +      if (prefix->name[3] == XML_T('n')
    +          && prefix->name[4] == XML_T('s')
    +          && prefix->name[5] == XML_T('\0'))
    +        return XML_ERROR_RESERVED_PREFIX_XMLNS;
    +
    +      if (prefix->name[3] == XML_T('\0'))
    +        mustBeXML = XML_TRUE;
    +    }
    +
    +    for (len = 0; uri[len]; len++) {
    +      if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len]))
    +        isXML = XML_FALSE;
    +
    +      if (!mustBeXML && isXMLNS 
    +          && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
    +        isXMLNS = XML_FALSE;
    +    }
    +    isXML = isXML && len == xmlLen;
    +    isXMLNS = isXMLNS && len == xmlnsLen;
    +
    +    if (mustBeXML != isXML)
    +      return mustBeXML ? XML_ERROR_RESERVED_PREFIX_XML
    +                       : XML_ERROR_RESERVED_NAMESPACE_URI;
    +
    +    if (isXMLNS)
    +      return XML_ERROR_RESERVED_NAMESPACE_URI;
    +  }
    +  else
    +    for (len = 0; uri[len]; len++)
    +      ;
    +
       if (namespaceSeparator)
         len++;
       if (freeBindingList) {
    
    From kwaclaw at users.sourceforge.net  Fri Dec 24 19:25:35 2004
    From: kwaclaw at users.sourceforge.net (Karl Waclawek)
    Date: Fri Dec 24 19:25:38 2004
    Subject: [Expat-checkins] expat/lib xmlparse.c,1.142,1.143
    Message-ID: 
    
    Update of /cvsroot/expat/expat/lib
    In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21975
    
    Modified Files:
    	xmlparse.c 
    Log Message:
    "if (ns)" check in addBinding() is not necessary, since it is only
    called when namespace processing is turned on.
    
    Index: xmlparse.c
    ===================================================================
    RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
    retrieving revision 1.142
    retrieving revision 1.143
    diff -u -d -r1.142 -r1.143
    --- xmlparse.c	24 Dec 2004 18:00:28 -0000	1.142
    +++ xmlparse.c	24 Dec 2004 18:25:32 -0000	1.143
    @@ -2927,6 +2927,26 @@
     addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
                const XML_Char *uri, BINDING **bindingsPtr)
     {
    +  static const XML_Char xmlNamespace[] = {
    +    'h', 't', 't', 'p', ':', '/', '/',
    +    'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/',
    +    'X', 'M', 'L', '/', '1', '9', '9', '8', '/',
    +    'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0'
    +  };
    +  static const int xmlLen = 
    +    (int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1;
    +  static const XML_Char xmlnsNamespace[] = {
    +    'h', 't', 't', 'p', ':', '/', '/',
    +    'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/',
    +    '2', '0', '0', '0', '/', 'x', 'm', 'l', 'n', 's', '/', '\0'
    +  };
    +  static const int xmlnsLen = 
    +    (int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1;
    +
    +  XML_Bool mustBeXML = XML_FALSE;
    +  XML_Bool isXML = XML_TRUE;
    +  XML_Bool isXMLNS = XML_TRUE;
    +  
       BINDING *b;
       int len;
     
    @@ -2934,63 +2954,38 @@
       if (*uri == XML_T('\0') && prefix->name)
         return XML_ERROR_UNDECLARING_PREFIX;
     
    -  if (ns) {
    -    static const XML_Char xmlNamespace[] = {
    -      'h', 't', 't', 'p', ':', '/', '/',
    -      'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/',
    -      'X', 'M', 'L', '/', '1', '9', '9', '8', '/',
    -      'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0'
    -    };
    -    static const int xmlLen = 
    -      (int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1;
    -    static const XML_Char xmlnsNamespace[] = {
    -      'h', 't', 't', 'p', ':', '/', '/',
    -      'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/',
    -      '2', '0', '0', '0', '/', 'x', 'm', 'l', 'n', 's', '/', '\0'
    -    };
    -    static const int xmlnsLen = 
    -      (int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1;
    -
    -    XML_Bool mustBeXML = XML_FALSE;
    -    XML_Bool isXML = XML_TRUE;
    -    XML_Bool isXMLNS = XML_TRUE;
    -
    -    if (prefix->name
    -        && prefix->name[0] == XML_T('x')
    -        && prefix->name[1] == XML_T('m')
    -        && prefix->name[2] == XML_T('l')) {
    +  if (prefix->name
    +      && prefix->name[0] == XML_T('x')
    +      && prefix->name[1] == XML_T('m')
    +      && prefix->name[2] == XML_T('l')) {
     
    -      /* Not allowed to bind xmlns */
    -      if (prefix->name[3] == XML_T('n')
    -          && prefix->name[4] == XML_T('s')
    -          && prefix->name[5] == XML_T('\0'))
    -        return XML_ERROR_RESERVED_PREFIX_XMLNS;
    +    /* Not allowed to bind xmlns */
    +    if (prefix->name[3] == XML_T('n')
    +        && prefix->name[4] == XML_T('s')
    +        && prefix->name[5] == XML_T('\0'))
    +      return XML_ERROR_RESERVED_PREFIX_XMLNS;
     
    -      if (prefix->name[3] == XML_T('\0'))
    -        mustBeXML = XML_TRUE;
    -    }
    +    if (prefix->name[3] == XML_T('\0'))
    +      mustBeXML = XML_TRUE;
    +  }
     
    -    for (len = 0; uri[len]; len++) {
    -      if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len]))
    -        isXML = XML_FALSE;
    +  for (len = 0; uri[len]; len++) {
    +    if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len]))
    +      isXML = XML_FALSE;
     
    -      if (!mustBeXML && isXMLNS 
    -          && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
    -        isXMLNS = XML_FALSE;
    -    }
    -    isXML = isXML && len == xmlLen;
    -    isXMLNS = isXMLNS && len == xmlnsLen;
    +    if (!mustBeXML && isXMLNS 
    +        && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
    +      isXMLNS = XML_FALSE;
    +  }
    +  isXML = isXML && len == xmlLen;
    +  isXMLNS = isXMLNS && len == xmlnsLen;
     
    -    if (mustBeXML != isXML)
    -      return mustBeXML ? XML_ERROR_RESERVED_PREFIX_XML
    -                       : XML_ERROR_RESERVED_NAMESPACE_URI;
    +  if (mustBeXML != isXML)
    +    return mustBeXML ? XML_ERROR_RESERVED_PREFIX_XML
    +                     : XML_ERROR_RESERVED_NAMESPACE_URI;
     
    -    if (isXMLNS)
    -      return XML_ERROR_RESERVED_NAMESPACE_URI;
    -  }
    -  else
    -    for (len = 0; uri[len]; len++)
    -      ;
    +  if (isXMLNS)
    +    return XML_ERROR_RESERVED_NAMESPACE_URI;
     
       if (namespaceSeparator)
         len++;