|
|
Comments and Discussions
|
|
 |

|
Thanks, but I need to be able to compile my app with the V100 toolset.
Another solution was posted in a related article "XMLLib for PUGXML with XPath".
Tim.
|
|
|
|

|
There seems to be a workaround, posted in another article that is based on pugxml:
XMLLib for PUGXML with XPath
In our context this suggestion works for both Visual Studio 2005 and 2010.
Thomas Haase
|
|
|
|

|
The code does not compile with UNICODE macro set on because you use TCHAR (that is wchar_t in Unicode) and std::string at the same time instead of std::wstring for UNICODE version.
Anyway, thanks for sharing!
|
|
|
|

|
Hi, I am new to XML files and its interpretation. I have an application (C++) that has to read data from an xml file. my xml file format <game name="race"> <min_credit>10.00</min_credit> <max_win>15.00</max_win> <volume>off</volume> </game> I want to read the values for each attribute in game with name = race How to do this? I have spent 1 full day reading the docs but cudnt succeed .. Ne help is very much appreciated
|
|
|
|

|
deepti_v25 wrote: I want to read the values for each attribute in game with name = race
How to do this?
There isn't a built-in way to to do this, although there is a function all_elements_by_bme which you could copy, paste and edit to do the same thing for attributes.
|
|
|
|

|
Hi,
I'm having a hard time trying to use the iterators with standard algorithms.
for example the following line always causes runtime errors in the destructor of forward_class:
xml_node::child_iterator iter = find(Node.children_begin(), Node.children_end(), srchr);
where srchr can be any type I have a comparison operator defined for.
Are the iterators explicitly not for use with standard algorithms, or is there a trick to it?
I'm using the member functions now, but I thought it would be nice to use the same algo's as in other parts of the code.
Rgds
Richi
|
|
|
|

|
hi
I am looking for a very small less then 100Kb size C or C++ based XML parser. Can you tell me that how Pug XML can help me in solving my problem.
Regards
|
|
|
|

|
Hello,
I compiled your code with Visual Studio 2005 and get the following errors:
1>d:\devtemp\pugxml\pugxml.h(338) : error C2065: 'i' : undeclared identifier
1>d:\devtemp\pugxml\pugxml.h(2385) : error C2666: 'pug::xml_node::has_name' : 2 overloads have similar conversions
1> d:\devtemp\pugxml\pugxml.h(2390): could be 'bool pug::xml_node::has_name(const TCHAR *) const'
1> d:\devtemp\pugxml\pugxml.h(2385): or 'bool pug::xml_node::has_name(const std::string &)'
1> while trying to match the argument list '(const char *)'
1> note: qualification adjustment (const/volatile) may be causing the ambiguity
1>d:\devtemp\pugxml\pugxml.h(3161) : error C2666: 'pug::xml_node::has_name' : 2 overloads have similar conversions
1> d:\devtemp\pugxml\pugxml.h(2390): could be 'bool pug::xml_node::has_name(const TCHAR *) const'
1> d:\devtemp\pugxml\pugxml.h(2385): or 'bool pug::xml_node::has_name(const std::string &)'
1> while trying to match the argument list '(TCHAR *)'
1> note: qualification adjustment (const/volatile) may be causing the ambiguity
1>d:\devtemp\pugxml\pugxml.h(3441) : error C2065: 'j' : undeclared identifier
I have enabled in the project settings "Force Conformance In For Loop Scope".
The C++ standard says that a variable declared in a for loop shall go out of scope after the for loop ends.
Andreas.
|
|
|
|

|
I Use Visual Studio 2005 also have the same problem,
anyone can help me
thanks
|
|
|
|

|
This problem is easy to fix. Just declare i variable before first for in each function that contains for.
for(long i=1; i<n; ++i) {
}
for (i=1; i<n; ++i) {
}
Fix:
long i = 0; for(i=1; i<n; ++i) {
}
for (i=1; i<n; ++i) {
}
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Discussion of techniques for fast, robust, light-weight XML parsing.
| Type | Article |
| Licence | |
| First Posted | 11 Jan 2003 |
| Views | 693,282 |
| Bookmarked | 277 times |
|
|