diff --git a/services/dynamic/dynamic-xml.service.js b/services/dynamic/dynamic-xml.service.js index 9a8eeffb812d52aac99e5a1d903174b384d4ee1d..2d8aad9ba1d5f0783123c1e4970c5929b9f7f23b 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: `<p> - 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. - </p>`, + description, parameters: queryParams( { name: 'url', @@ -38,7 +49,7 @@ export default class DynamicXml extends BaseService { { name: 'query', description: - 'A <a href="http://xpather.com/">XPath</a> 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', },