expat-parser

Expat prints out garbage when I print to screen or file

徘徊边缘 提交于 2021-02-10 19:54:54
问题 When I print out information from my XML document I get �� before each line. Here is my XML document. <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> Here is my code #include <cstdio> #include <expat.h> #include <string> #include <fstream> #include <cstring> using namespace std; void XMLCALL start(void*,const char*, const char**); void XMLCALL end(void*,const char*); void XMLCALL

XML CharacterDataHandler callback unpextedly called multiple times

怎甘沉沦 提交于 2021-01-29 04:52:58
问题 I'm learning about libexpat. I cobbled together this example for basic familiarity using the API: The Code : #include <stdio.h> #include <expat.h> #include <string.h> #include <iostream> void start(void* userData, const char* name, const char* argv[]) { std::cout << "name: " << name << std::endl; int i = 0; while (argv[i]) { std::cout << "argv[" << i << "] == " << argv[i++] << std::endl; } } void end(void* userData, const char* name) { } void value(void* userData, const char* val, int len) {

XML CharacterDataHandler callback unpextedly called multiple times

て烟熏妆下的殇ゞ 提交于 2021-01-29 04:51:14
问题 I'm learning about libexpat. I cobbled together this example for basic familiarity using the API: The Code : #include <stdio.h> #include <expat.h> #include <string.h> #include <iostream> void start(void* userData, const char* name, const char* argv[]) { std::cout << "name: " << name << std::endl; int i = 0; while (argv[i]) { std::cout << "argv[" << i << "] == " << argv[i++] << std::endl; } } void end(void* userData, const char* name) { } void value(void* userData, const char* val, int len) {

How to compile expat with iOS SDK 5.1?

坚强是说给别人听的谎言 提交于 2019-12-22 18:14:09
问题 How to compile expat with iOS SDK 5.1? I tried to adapt/upgrade from all older scripts, but nothing worked... Could anybody do it already? 回答1: I found it! I used the following script: https://github.com/x2on/expat-ios The problem is that the command "xcode-select -print-path", used in the compilation script, is showing "/Developer" instead of the correct full path including "/Applications/Xcode.app/Contents/Developer". I just changed it and then it worked! The last XCode [SDK 5.1] moved the

Android parsing an xml with saxparser

半腔热情 提交于 2019-12-21 20:22:25
问题 I am trying to parse an xml file withSaxParser on Android. This is my xml file: <?xml version="1.0" encoding="UTF-8"?> <cars> <car model="CitroenC3"> <maintenances> <xm:maintenance xmlns:xm="it.a.b.android.c.car.m" distance="" price=""> <xm:type></xm:type> </xm:maintenance> </maintenances> <chargings> <xc:charging xmlns:xc="it.a.b.c.fuelconsumption.car.m" quantity="18" price="20" distance="400" consumption="14"/> </chargings> </car> </cars> And this is the code: // Handling XML

error at building libjingle on Mac OS X 10.7.2 like “error: string.h: No such file or directory”

烈酒焚心 提交于 2019-12-20 06:09:42
问题 I failed to build libjingle on Mac OS X 10.7.2. The output was the following when I run $path_to_swtoolkit/hammer.sh according to the README of libjingle. MBP17:talk rei25$ ~/Desktop/swtoolkit/hammer.sh scons: Reading SConscript files ... scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. File "/Users/rei25/Desktop/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts scons: done reading SConscript files. scons: Building

Can I enforce the order of XML attributes using a schema?

时光毁灭记忆、已成空白 提交于 2019-12-17 16:34:15
问题 Our C++ application reads configuration data from XML files that look something like this: <data> <value id="FOO1" name="foo1" size="10" description="the foo" ... /> <value id="FOO2" name="foo2" size="10" description="the other foo" ... /> ... <value id="FOO300" name="foo300" size="10" description="the last foo" ... /> </data> The complete application configuration consist of ~2500 of these XML files (which translates into more than 1.5 million key/value attribute pairs). The XML files come

PHP XML Expat parser: how to read only part of the XML document?

两盒软妹~` 提交于 2019-12-12 08:14:18
问题 I have an XML document with the following structure: <posts> <user id="1222334"> <post> <message>hello</message> <client>client</client> <time>time</time> </post> <post> <message>hello client how can I help?</message> <client>operator</client> <time>time</time> </post> </user> <user id="2333343"> <post> <message>good morning</message> <client>client</client> <time>time</time> </post> <post> <message>good morning how can I help?</message> <client>operator</client> <time>time</time> </post> <

libxml2 vs expat for an XMPP server

情到浓时终转凉″ 提交于 2019-12-12 08:03:13
问题 I'm trying to create an XMPP library (and later a server) from scratch in Go (although the language itself is irrelevant) as a means to learn what I can about the XMPP protocol and server software development in general. As many of you know, XMPP is messaging protocol based on XML that depends on an enormous amount of short but frequent XML streams. I'm thinking that for such applications an event based XML parser should be better because I won't need DOM and all that (correct me if I'm wrong

gdb building with expat

混江龙づ霸主 提交于 2019-12-12 04:26:44
问题 I can't seem to get the syntax right for building gdb on Windows 10 (mingw), with expat. I downloaded expat sources and had no problems building. The expat.h file is in /usr/local/include and the expat library (libexpat.a and libexpat.dll.a) ended up in /usr/local/lib My config is: ../gdb-7.7.1/configure --target=arm-linux-gnueabihf --prefix /c/sysGCC/output --with-python --with-expat --with-libexpat-prefix=/usr/local/lib --disable-nls But no matter what I try I always get a make error