0

Just trying to understand what this XPath is doing

"//*[local-name()='Fault']/*[local-name()='detail']/*[local-name()='serviceFault']/*[local-name()='messages']/*[local-name()='message']/*[local-name()='code']"

What I believe it's doing is scanning the whole XML file to find Fault, detail, serviceFault, messages, message, code?

And if so is this an and function or an or function? And what I mean is, is looking for fault or detail, or ..., or is it doing looking fault and detail and serviceFault and ...?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
Newb18
  • 167
  • 2
  • 11

1 Answers1

1

Understand:

  1. //e selects all e elements in the XML document.
  2. p/c selects the c children elements of a p parent element.
  3. *[local-name()='ln'] is the same as ln but ignores XML namespaces.

Then, your XPath ignores XML namespaces and selects all code elements in the document that have a heritage of Fault/detail/serviceFault/messages/message, where Fault may occur anywhere in the XML document.

See also

kjhughes
  • 106,133
  • 27
  • 181
  • 240