Home
Analytics
How to get the node name of an element via XPath in BIRT?
mamann
Hi everybody,
recently we started designing test reports with BIRT based on XML files. Generally speaking, this works really great.
As we are processing XML it is necessary that we can access attributes and nodes. Attribute access works perfectly, but I couldn't figure out a way to return the node name. The node name is important as this element determines the formatting of a row in the report.
Let's say, I got the following XML snippet:
__<report>
____<steps>
______<perform action="...">
________<result error="..." />
______</perform>
____<validate condition="...">
________<result error="..." />
______</validate>
____</steps>
__</report>
If I want to report all steps in the BIRT report, I query /report/steps/* which returns what I need.
Is there a way how I can access the node name of the requested element as a "row"? It would be great if you could give me a hint.
Best regards
Michael
Find more posts tagged with
Comments
bhanley
The node name will be hard to get to using XPath as I do not think the "name()" function is supported.
If the XML is fairly well-structured, you could use the column-mapping step to get what you need. Can you give a little more context to your sample XML? What condition determines formatting exactly?