0

Can someone please tell me the "correct / most-efficient way" of getting the "Status" XML attributes (ID, CssClass, Description, and IsActive for the XML below:

Implementation will be Java - (but I am more interested in the XPath):

<ArrayOfLineStatus>
<LineStatus ID="0" StatusDetails="">
    <BranchDisruptions/><Line ID="1" Name="Bakerloo"/>
    <Status ID="GS" CssClass="GoodService" Description="Good Service" IsActive="true">          
    <StatusType ID="1" Description="Line"/></Status></LineStatus>
[snip]
 </ArrayOfLineStatus>

Thank,

Miles.

0

1 Answer 1

3

@* selects all attributes of the context node. Use:

/*/*/Status/@*

Or, more specifically:

/ArrayOfLineStatus/LineStatus/Status/@*

Or, for Status elements appearing anywhere in the document:

//Status/@*
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.