Giter Site home page Giter Site logo

rapidxml's People

Contributors

dwd avatar giszo avatar lightningbilly avatar paroj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rapidxml's Issues

ptrdiff_t

GCC 6.1.1 complained about ptrdiff_t in xmlns_lookup. Changing it to std::ptrdiff_t resolved the issue.

typename problem

GCC 6.1 (and Clang) complained about typename keyword in node_iterator and attribute_iterator typedefs. Removing typename fix the problem.

Pull Request:
#6

Misalignment in cast after allocation for ARM gcc

At least one cast (and possible others) will cause "increases required alignment of target type [-Werror=cast-alig]" when compiling on ARM/RaspberryPi.
I saw the error in line 672: header *new_header = reinterpret_cast<header *>(pool);

With gcc, I change to:
// __builtin_assume_aligned is a GCC directive; this paper -
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0886r0.pdf
// - outlines the directives for some other compilers. Looks
// like we can use std::assume_aligned from C++2020 onwards:
// https://en.cppreference.com/w/cpp/memory/assume_aligned
header *new_header = reinterpret_cast<header *>(__builtin_assume_aligned(pool, RAPIDXML_ALIGNMENT));

That made my code compile.

I imagine there may be other places where __builtin_assume_aligned is needed in rapidxml.hpp

Non-fatal non-exception based error handling should be provided

Using exceptions is the only way to parse xml and have it not crash the program on a formatting error. So if we can't use exceptions, rapidxml becomes unusable if you want to gracefully handle bad formatting.

The usage of a globally linked error handler is also problematic, multiple places in the code using rapidxml w/o exceptions will cause linking problems, and it requires workarounds to wrap the #include <rapidxml.hpp> in a namespace so multiple error handlers can be provided.

Ideally a function pointer object could be provided to rapidxml that would allow us to do our own exception handling, that could contain user data where we can map to our own local information, so the filename and such can be printed in a thread-safe manner.

Issue in Parsing big files

Hi,
I am using rapidxml in my project. it is working fine with small files but once the file size increases more then 65KB then searching first node gives segmentation fault error

surprising interactions between // values and data nodes

Hi all,

I found the following issue: I am parsing my XML as following

vector xml_copy(input_xml.begin(), input_xml.end());
xml_copy.push_back('\0');
xml_document<> doc;
doc.parse<parse_declaration_node>(&xml_copy[0]); // just get the XML declaration

By doing so, I am able to see all my object as well with the CDATA, but if I try to modify some value with the value() method, then only the print() method does not reflect it. However, at node level using the value() method the changes seems to be taken.

I found this issue working at the python binding at the following repository:

https://github.com/Arzaroth/python_rapidxml

Moreover, in the following link I found the following information:
http://www.setnode.com/blog/quick-notes-on-how-to-use-rapidxml/

// we are choosing to parse the XML declaration
// parse_no_data_nodes prevents RapidXML from using the somewhat surprising
// behavior of having both values and data nodes, and having data nodes take
// precedence over values when printing
// >>> note that this will skip parsing of CDATA nodes <<<
doc.parse<parse_declaration_node | parse_no_data_nodes>(&xml_copy[0]);

// alternatively, use one of the two commented lines below to parse CDATA nodes,
// but please note the above caveat about surprising interactions between
// values and data nodes (also read http://www.setnode.com/blog/a-rapidxml-gotcha/)
// if you use one of these two declarations try to use data nodes exclusively and
// avoid using value()
//doc.parse<parse_declaration_node>(&xml_copy[0]); // just get the XML declaration
//doc.parse<parse_full>(&xml_copy[0]); // parses everything (slowest)

Currently, I do not need to generate an XML using the parse_declaration_node, therefore I am not going to work on it straight after. However, I guess I might be nice to fix this misbehavior.

Regards,
Amedeo

Document how to build

Could you add a quick README with build instructions?

I tried copying rapidxml.hpp into test/ and running:

gcc -std=c++11 simple.cpp

but I get many errors like this:

/tmp/ccDIYmHD.o: In function `main':
simple.cpp:(.text+0xd2): undefined reference to `std::allocator<char>::allocator()'
simple.cpp:(.text+0xed): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'

This is with gcc 4.7.3 on Ubuntu. Does it require a 4.8 gcc?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.