diff --git a/services/dynamic/dynamic-xml.service.js b/services/dynamic/dynamic-xml.service.js index 9a8eeffb81..2d8aad9ba1 100644 --- a/services/dynamic/dynamic-xml.service.js +++ b/services/dynamic/dynamic-xml.service.js @@ -10,6 +10,20 @@ import { } from '../index.js' import { createRoute } from './dynamic-helpers.js' +const description = ` +The Dynamic XML Badge allows you to extract an arbitrary value from any +XML Document using an XPath selector and show it on a badge. + +Useful resources for constructing XPath selectors: +- [XPather](http://xpather.com/) +- [XPath Cheat Sheet](https://devhints.io/xpath/) + +Note: For XML documents that use a default namespace prefix, you will need to use the +[local-name](https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/local-name) +function to construct your query. +For example \`/*[local-name()='myelement']\` rather than \`/myelement\`. +` + // This service extends BaseService because it uses a different XML parser // than BaseXmlService which can be used with xpath. // @@ -24,10 +38,7 @@ export default class DynamicXml extends BaseService { '/badge/dynamic/xml': { get: { summary: 'Dynamic XML Badge', - description: `
- The Dynamic XML Badge allows you to extract an arbitrary value from any - XML Document using an XPath selector and show it on a badge. -
`, + description, parameters: queryParams( { name: 'url', @@ -38,7 +49,7 @@ export default class DynamicXml extends BaseService { { name: 'query', description: - 'A XPath expression that will be used to query the document', + 'An XPath expression that will be used to query the document', required: true, example: '//slideshow/slide[1]/title', },