Uploaded image for project: 'Fuse Tooling'
  1. Fuse Tooling
  2. FUSETOOLS-491

mention in the docs about how folks can test out XPath expressions in Fuse IDE

    XMLWordPrintable

Details

    • Documentation
    • Resolution: Won't Do
    • Minor
    • 7.1.0
    • None
    • None
    • None

    Description

      This is probably documented in detail somewhere inside Eclipse itself (we could maybe link to its docs if we can find it in the standard eclipse help) but XPath is a common expression in Camel EIPs. e.g. a Filter or Content Based Router often uses XPath as the expression language.

      Fuse IDE ships wiht an XPath view which helps evaluate Xpath expressions to see what matches etc.

      You can test out XPath expressions on XML documents in Fuse IDE. Open some XML file in Fuse IDE (using the XML editor; e.g. on an XML file it should open in the XML editor or right click -> Open With -> XML Editor). then pull down menu Window -> Show View -> XML -> XPath and you get an XPath selector that lets you try out XPath expressions to see what it matches

      Incidentally a common gotcha with XPath and XML is namespaces which it might be worth describing too; basically if a document uses an xml namespace (with prefix or no prefix)

      e.g.
      http://stackoverflow.com/questions/6390339/how-to-query-xml-using-namespaces-in-java-with-xpath

      this xpath won't match any <foo> elements if the XML has a xmlns="something" statement (since all elements are not in the default namespace)...

      /foo

      (which means "foo" local name in no namespace URI) you must use

      /*[local-name() = 'foo']

      to be namespace URI agnositc

      Or map a prefix...

      /x:foo

      Attachments

        Activity

          People

            jmurphey_jira Jane Murphey (Inactive)
            jastrachan_jira James Strachan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: