RE: [xml] A question about '&'

I apologize if I'm just missing the obvious here, but a simple code as
following seems doesn't work:
#include "libxml/parser.h"
int main(int argc, char* argv[])
        xmlDocPtr pXMLDOCdoc;
        pXMLDOCdoc=xmlNewDoc((const unsigned char *)("1.0"));
        pXMLDOCdoc->children=xmlNewDocNode(pXMLDOCdoc,NULL,(const unsigned
char *)("TEST"),NULL);
        xmlNewChild(pXMLDOCdoc->children,NULL,(const unsigned char
                        (const unsigned char *)"A&W");
        return 0;
In c:\test.xml I got:

<?xml version="1.0"?>

Instead of

<?xml version="1.0"?>

Any ideas? 
I am using xmllib ver 2.3.8, vc++6.0+sp5, windows 2000 pro+sp1.
By the way, xmlKeepBlanksDefault(0) seems doesnt work under window 2000. You
can prove this by using xmllint -debug -noblans gjobs.xml. Please have a
look of this issue. Thank you very much for your help again.   

-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com]
Sent: Thursday, May 03, 2001 00:14
To: Ming Lu
Cc: xml gnome org
Subject: Re: [xml] A question about '&'

On Wed, May 02, 2001 at 03:36:52PM -0700, Ming Lu wrote:
Thank you very much for your replay and I still wonder if xml lib escape
'>','<',''' and'"' automatically, should it also escape '&'?

  yes, it does on output,


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]