Can you please point me to the information?

I was simply putting strings:

fputs("<complexType name=''DominantColorType" final=''#all''>\n",fp);

But I get an "error" at ''#''. Anyone know why ?

[
Does this[^] help? I''ve not used it, just found it with a quick search.


思想:
fputs("<complexType name='DominantColorType" final='#all'>\n",fp);



仔细看看DominantColorType"

您可能是说DominantColorType''

对于纯c实现:
Gnome的XML C解析器和工具包
[^ ]

并且有 Apache Xerces [



Take a closer look at DominantColorType"

you probably meant DominantColorType''

For a pure c implementation:
The XML C parser and toolkit of Gnome
[^]

and the there is this Apache Xerces[^] - it''s C++ though

Regards
Espen Harlinn


所有您需要自己编写代码,并且首先必须了解XML.

我可以给一些提示

您需要像这样定义宏
All you need to write your code by own and first of all you must know XML.

I just can give some hints

You need to define your macros like this
<pre lang="xml">#include <stdio.h>
#include <tchar.h>
#define START_NODE( \
     /*NULL TERMINATED STRING*/NodeName , \
     FilePointer) \
     fprintf( FilePointer , "<%s>\n" , NodeName ) \
#define END_NODE( \
     /*NULL TERMINATED STRING*/NodeName , \
     FilePointer) \
     fprintf( FilePointer , "</%s>\n" , NodeName ) \
int _tmain(int argc, _TCHAR* argv[])
{
    FILE *fp = NULL;     /*i use stdout in place of a file pointer
                         to show the result on concole*/
    START_NODE("t1", stdout);
    END_NODE("t1", stdout);
    getchar();
    return 0;
}




但是使用这些宏您不能将属性赋予节点 ...

如果您不需要属性,则可以执行此操作....

如果需要的话,使用函数代替宏 ...




but using these MACROs you can''t give attributes to nodes...

This will do if you don''t need attributes....

If you want then use functions instead of macros...


相关推荐