Hub
  • Software
  • Blog
  • Forum
  • Events
  • Documentation
  • About KNIME
  • KNIME Hub
  • Nodes
  • XPath
NodeNode / Manipulator

XPath

Structured Data XML Streamable
Drag & drop
Like
Copy short link

The node takes the XML Documents of the selected column and performs XPath queries on them. The node supports XPath 1.0.

XPath Syntax

Selection Nodes

Expression Description
nodename Selects all nodes with the name "nodename"
/ Selects from the root node.
// Selects nodes in the document from the current node that match the selection no matter where they are
. Selects the current node
.. Selects the parent of the current node
@ Selects attributes

Predicates

Path Expression Result
/bookstore/book[1] Selects the first book element that is the child of the bookstore element.
/bookstore/book[last()] Selects the last book element that is the child of the bookstore element
/bookstore/book[last()-1] Selects the last but one book element that is the child of the bookstore element
/bookstore/book[position()<3] Selects the first two book elements that are children of the bookstore element
//title[@lang] Selects all the title elements that have an attribute named lang
//title[@lang='en'] Selects all the title elements that have a "lang" attribute with a value of "en"
/bookstore/book[price>35.00] Selects all the book elements of the bookstore element that have a price element with a value greater than 35.00
/bookstore/book[price>35.00]/title Selects all the title elements of the book elements of the bookstore element that have a price element with a value greater than 35.00

Syntax description from w3cschools.com .

Hint for streaming: Node can only be executed in real streamed fashion if every single XPath query is configured as follow (see XPath Query Settings):
The column names are fixed (i.e. select 'new column name') and either 'Single Cell', 'Collection Cell', or 'Multiple Rows' are selected as 'Multiple tag option'.

Node details

Input ports
  1. Type: Table
    Input Table
    Input table containing at least one XML column.
Output ports
  1. Type: Table
    Output Table
    The input table with additional columns containing the result of the XPath queries.

Extension

The XPath node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
    XMLを読み取る - Xpath
    Japanese 日本語 Makkynm
    +5
    XPathの紹介用Workflowです。 This workflow is to introduce XPath
    makkynm > Public > Advanced > A112_XMLSplit_Xpath
  2. Go to item
    xpath fun
    gab1one > Public > Forum > xpath fun
  3. Go to item
    Query Google For Address
    This workflow takes a single input about a location from a user, converts it to a Google …
    scottf > Public > ForumWorkflows > 2019 > 12 > Query_Google_for_address
  4. Go to item
    Query Google For Address
    This workflow takes a single input about a location from a user, converts it to a Google …
    mmarag > Public > Query_Google_for_address
  5. Go to item
    Tableau_Personal_Access_Token_auth_workaround
    bwilhelm > Public > Tableau_Personal_Access_Token_auth_workaround
  6. Go to item
    List Extensions
    This workflow finds all nodes in a workflow or a workflow group and extracts the KNIME fe…
    alexanderfillbrunn > Public > Helpers > List Extensions
  7. Go to item
    GET Request Example (Life Sciences)
    REST Genes Life Sciences
    In this workflow snippet, we will use the REST service provided by MyGene.info [1,2] (htt…
    knime > Workflow Snippets > GET Request
  8. Go to item
    SDN Tool
    brissettej > Public > SDN Tool
  9. Go to item
    WebScraping Christmas Songs
    kathrin > Forum Questions > WebScraping Christmas Songs
  10. Go to item
    WebScraping Christmas Songs
    pa3dso > Public > WebScraping Christmas Songs
  1. Go to item
  2. Go to item
  3. Go to item
  4. Go to item
  5. Go to item
  6. Go to item

KNIME
Open for Innovation

KNIME AG
Hardturmstrasse 66
8005 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • E-Learning course
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • KNIME Open Source Story
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more on KNIME Server
© 2022 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Credits