Comments (3)
Has there been a fix or update to this? before i dive into the world of monkey patching this, i want to see if there has been any update.
from crack.
I also run into this when empty valid xml elements are returned from a library. The point is that I cannot know whether what I get in the hash is the value itself or the attributes, and is so relevant in my case.
I think that there should be a way to be able to switch from the current implementation to another one, where both elements and attributes are included, making use of a configurable prefix in the keys of the attributes.
This way backward compatibility is mantained and everybody can make use of the new functionallity adapting the prefix to fits their domain problem.
from crack.
I ran into this as well and started looking at the code/working on a fix. Your attributes ARE there, it's just poorly documented. The relevant code is here:
https://github.com/jnunemaker/crack/blob/master/lib/crack/xml.rb#L85-86
The REXMLUtilityNode has an @attributes accessor added to hold the attributes.
from crack.
Related Issues (20)
- YAML load errors when parsing JSON that initially contained a \u0000 character sequence HOT 2
- Psych::SyntaxError while parsing JSON using rails 3.0.2/ruby 1.9.2p180 HOT 9
- Crack treats JSON parsing errors differently depending on the underlying YAML parser HOT 1
- parsing of XML return a singleton Hash that is not dumpable HOT 4
- Xml not parsing properly HOT 1
- Add bigdecimal to gemspec HOT 1
- many json tests are failing with ruby 1.9 HOT 2
- Fails to run Jekyll 1.0.3 (conflicting versions of safe_yaml) on Mac OSX 10.8.3 HOT 1
- Support for Attributes HOT 2
- Crack::JSON is not parsing UTF-8 correctly HOT 1
- Crack::JSON can't parse valid json string with UTF-8 character
- Issue with array of elements when the key is an attribute of the nodw HOT 2
- Key mangling when using two dates HOT 1
- Crack 0.4.3 cannot parse two consecutive dates HOT 1
- Xml parsing dont return attribute of tag HOT 1
- make a 1.0.0 release? HOT 5
- Remove `test/` from bundled gem HOT 4
- Please include license file in the gem. HOT 1
- Missing v0.4.5 tag HOT 2
- JSON failures with Ruby 3.1 / Psych 4.0
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 crack.