The XML ValidatorBuddy editor includes a user-friendly search and replace feature for quickly finding text in XML or JSON data. However, for more precise control—such as searching only within XML attribute values or finding elements with a specific name—you can use the XPath evaluator window in the editor. This functionality is available in all editions of XML ValidatorBuddy.
To locate instances of the word "Oak" as a separate word within the text content of any element, use the following XPath expression:
XPath: //*[text()[matches(., '(^|[\t\n ])Oak($|[\t\n ])')]]
To search for all elements where the tag name ends with "name" in a case-insensitive manner, use:
XPath: //*[local-name()[matches(., 'name$', 'i')]]
If you want to search for all elements that contain an attribute with the value "active", use this XPath expression:
XPath: //*[@*[matches(., 'active')]]
This will return all elements that have any attribute whose value matches "active."
For more information on using regular expressions in XPath statements, refer to the relevant guidelines on w3c.org.
Using XPath for find and search operations provides a significant advantage over plain text editors. It allows users to target specific elements and attributes, perform complex queries, and retrieve precise results, making XML and JSON data management much more efficient and effective than traditional text editing methods.
XML ValidatorBuddy is more than just an XML editor. Learn more on clicking the images and links below.
View and edit large XML data - not limited to well-formed input
Learn moreXML editor for Windows ® with syntax-coloring, code folding and many more...
Learn more