Comments (2)
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.
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)
- Assertion fails during number-to-string conversion if wrong C locale is set (non-MSVC) HOT 1
- Support std::filesystem::path HOT 2
- Version 1.14 HOT 1
- Can you add the ability to access child nodes using index? HOT 1
- PUGIXML_WCHAR_MODE and error messages. HOT 1
- add xml_node_type_str function for debugging and application logging HOT 3
- option to join multiple CDATA sections into one when parsing HOT 2
- parse_embed_pcdata and parse_merge_pcdata don't play together HOT 2
- Unexpected #endif in line 13201 with precompilation in a pch.h file HOT 2
- XML Canonicalization: as an option, allow parsing eol's into the document model (as PCDATA holding those) HOT 2
- Warning when building 1.14 in x86 on Clang HOT 3
- Position of the parse result offset in case of status_bad_start_element
- Error in handling loading errors example HOT 1
- Incorrect result of xml_document::load_file -"File was not found" HOT 2
- Question: I have made my own case insensitive version, is that ok? HOT 2
- Serilisation HOT 4
- pugi::xml_node and std::ranges, maybe a documentation request HOT 2
- call function xml_node::empty() always return false in anyway HOT 3
- Not able to attach a xsl via a `<?xml-stylesheet ...?>` node HOT 1
- xmldocument::save uses non-transformed encoding parameter HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pugixml.