Closed alepeino closed 7 years ago
Hi dear @alepeino and thank you again for your appreciated PLs.
FluidXML is a library mainly intended for manipulating XML files.
As you can see from the API, it is made by methods used to mutate the document or to export it. Reading the internal state of the document is not a goal for the 1.x
release but it will probably change in the 2.x
release implementing a reading-specific API style.
Unfortunately implementing the ->text()
getter method would break the coherence of the API mainly duplicating features already implemented in the native DOM API.
Even if your effort in this PL is very much appreciated, I can not accept it at least for the 1.x
releases. It will be probably part of the 2th main release of FluidXML, but for now I can not merge it.
Thank you very much again for you effort.
Yes, I understand what you mean. In my current project I'm reading/parsing XMLs as much as I am writing/manipulating them. That's how I thought of these features I have sent, since I thought the reading-specific part could also benefit from a fluid, elegant and convenient API. I'll wait for v2, to which I will try to contribute as well.
Added
->getText()
that returns the text content of nodes in a context. Also short version as->text()
(no parameter). --> What do you think ofPHP_EOL
as default? Maybe','
better? Or''
?