Git Product home page Git Product logo

Comments (2)

zeux avatar zeux commented on August 28, 2024

XML is usually case sensitive, so case insensitive comparisons are rarely needed.
Additionally, implementing a correct Unicode-aware case-sensitive comparison is relatively involved.

Both of these combined mean that this feature does not really fit pugixml. It should be straightforward to implement custom functions that you may need as helpers, e.g. xml_node child_ignorecase_ascii(xml_node, const char*) in your header file.

from pugixml.

mr-phazer avatar mr-phazer commented on August 28, 2024

To author: Thanks for an amazing product, I have used for everything for 3-4 years now :)
I have made a "version" og PUGI-XML has has child_no_case() and atrribute_no_case() added methods,

PUGI_IMPL_FN xml_node xml_node::child_no_case(const char_t* name_) const
{
	if (!_root) return xml_node();

	for (xml_node_struct* i = _root->first_child; i; i = i->next_sibling)
	{
		const char_t* iname = i->name;			
		if (iname &&  toUpper(name_) == toUpper(iname))			
			return xml_node(i);
	}

	return xml_node();
}

and similar for attribute, i have recent had "toUpper/toLower" code fixed to avoid to signed char issue,,,
https://en.cppreference.com/w/cpp/string/byte/toupper#:~:text=current%20C%20locale.-,Notes,-Like%20all%20other
so it should be legal enough?
it is not like it is rocket-science, I but could look at how portable my code is, and maybe push it?
There is also a simple way to make the whole library case-insentive, by changing impl::strequal() perhaps with conditional compiling ofc you guys are coders, you you know already :)

from pugixml.

Related Issues (20)

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.