./prontouso.com
ALAT DEVELOPER

Penguji XPath

Jalankan dan uji ekspresi XPath (XPath 1.0) pada dokumen XML atau cuplikan HTML untuk mengekstrak node, atribut, dan teks secara akurat di browser Anda.

Status alatBerjalan di browser Anda
Pratinjau

Hasil

0 node(s)/value(s).

Cara kerja

  1. Masukkan data Anda

    Isi nilai yang diperlukan, tempel teks Anda, atau unggah file yang ingin diproses.

  2. Lihat hasil seketika

    Sebagian besar alat diperbarui secara langsung saat Anda mengetik; beberapa menggunakan satu tombol tindakan.

  3. Gunakan hasil Anda

    Salin, unduh, atau bagikan hasil yang dihasilkan — Anda selalu memiliki kendali penuh atas data Anda.

Privasi dan pemrosesan dataBerjalan secara lokal di browser Anda. Alat ini tidak mengunggah data Anda.

Apa itu Penguji XPath?

Paste XML and an XPath expression to inspect selected nodes, text values, numbers, or booleans.

PAHAMI CARA KERJA ALAT

How to test XPath expressions

What it evaluates

The tester uses the browser XPath engine when available. It can return node sets, strings, numbers, and booleans depending on the expression.

Reading node output

Node-set results are shown as trimmed text content or serialized XML for nodes without text. Long node lists are capped so the output stays readable.

Good XML inputs

  • Use well-formed XML with one root element.
  • Keep namespace-heavy documents simple when possible, since this first tester does not include namespace mapping controls.
  • Check scalar expressions such as count(//item) when you only need a number.

Testing notes

XPath behavior can vary when a browser lacks XPath APIs or when XML relies heavily on namespaces. Confirm critical expressions in your production parser.

Pertanyaan yang Sering Diajukan (FAQ)

Does it support XML namespaces?

There is no custom namespace resolver in this first version, so namespace-heavy XML may need simpler expressions or a dedicated XML tool.

Why does it say XPath needs a browser environment?

The evaluator depends on DOMParser and document.evaluate. If those APIs are not available, the tool reports that limitation instead of throwing an error.

Can it return numbers or booleans?

Yes. Expressions such as count(//book) or boolean(//price) return scalar values instead of node lists.

Why is my XML invalid?

The XML parser rejects malformed documents, such as missing closing tags, multiple root elements, or broken entity references.