History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-2812
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Marc Palmer
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
groovy

Please make toString on GPath XML nodes return value of text() and/or add getText() getter to node

Created: 07/May/08 03:00 PM   Updated: 07/May/08 09:03 PM
Component/s: XML Processing
Affects Version/s: 1.5.5
Fix Version/s: 1.7

Time Tracking:
Not Specified


 Description  « Hide
Guys, am I missing something - it's very painful when using XmlParser and trying to get the value text of nodes, having to call text() all the time and remember it is a method.

At the very least node.text (calling getText()) should work.

Even better, have toString() on the node return the text instead of something that looks like the output of dump()



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King - 07/May/08 09:03 PM
.text is reserved for Nodes which have sub nodes with that name.

I don't usually find it hard to remember. All Groovy "associative" type collections, e.g. SQL, XML, Maps require you to use methods.