XML

XML Path Finder

Lists every distinct element and attribute path in a document, with an occurrence count and the first value found at each.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the document you want to explore.
  2. Select List paths.
  3. Compare each occurrence count against the number of records: anything lower is an optional field your code has to handle as missing.

What xml path finder does

When you are handed an unfamiliar XML file the first question is what is actually in it, and the second is what to write in an XPath expression to reach a particular value. This tool answers both by walking the whole document and listing every distinct path once, with the number of times it occurred and the first value it found there.

The occurrence count is the useful part. A path that occurs as many times as the row element is a field every record has; a path that occurs a handful of times is optional, and any code reading the file has to cope with it being missing. The paths are written in ordinary XPath location syntax and ignore namespaces, so a document using prefixes will need those added by hand.

Frequently asked questions

They are location paths in XPath syntax, and they work as written for a document without namespaces. If your document uses prefixes, most XPath engines need those prefixes bound before the path will match, and you will have to add that yourself.

It tells you which fields are always present and which are optional. A path occurring as often as the record element is on every record; anything less is optional, and code that assumes it is there will fail on real data.

Yes, written the way XPath writes them — a path ending in /@id points at that attribute rather than the element. Turn them off with the option if you only want the element structure.