OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Internal entities removed from XML?

[ Lists Home | Date Index | Thread Index ]

> Only benchmarking/profiling can tell

It's hard to beat this:
int
expand_entities_in_text_node(char* buff, int size)
{
     char *start, *src;
     for (start = src = buff; --size >= 0; )
     {
         if ((*buff++ = *src++) == '&')
         {
             if (size >= 3
             && src[0] == 'l' && src[1] == 't' && src[2] == ';')
                 buff[-1] = '<', src += 3, size -= 2;
             else if (size >= 4
                  && src[0] == 'a' && src[1] == 'm' && src[2] == 'p'
                  && src[3] == ';')
                 src += 4, size -= 3;
         }
     }
     return buff - src;
}







 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS