[jdom-interest] XPath from Element

Todd O'Bryan toddobryan at mac.com
Wed Jul 16 16:22:17 PDT 2003


I'm using XML to write a mini-programming language (very mini), but I 
need to be able to catch syntax errors and tell the user where they 
occur.

Is there a way to get an XPath representation of an Element from the 
element?

For example,

<x>
	<y>
		<z>...</z>
		<z>...</z>
		<z>Error here</z>
	</y>
</x>

When I discover the error processing the element shown, is there any 
way to get
/x/y/z[2] from somewhere?

Thanks,
Todd




More information about the jdom-interest mailing list