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

Key: GROOVY-1193
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Paul King
Reporter: Dierk Koenig
Votes: 0
Watchers: 0
Operations

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

new convenience methods in DOMCategory: InputStream.parse; Reader.parse; Node.xpath

Created: 20/Dec/05 10:13 AM   Updated: 10/Feb/08 02:24 PM
Component/s: groovy-jdk, XML Processing
Affects Version/s: 1.0-JSR-4
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
parse methods should be short for:

def fac = DocumentBuilderFactory.newInstance()
def builder = fac.newDocumentBuilder()
def doc = builder.parse(new FileInputStream('filename'))
def root = doc.documentElement

Node.xpath should be short for
org.apache.xpath.XPathAPI.eval(node, 'xpath')

Not sure whether we should also overload get and/or getAt[] with xpath meaning, since that will conflict with current element/attribute access



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King - 19/Dec/07 01:23 AM
DOMBuilder has this method:
public static Document parse(Reader reader, boolean validating, boolean namespaceAware)

Do you believe this covers off the first requirement for this issue?

Do you still feel a need to have special sugar for xpath?


Paul King - 10/Feb/08 02:24 PM
I plan to split the xpath part out into a separate issue so that the first part can be closed off.