From cee41f5818c65a9f1084ce731efaf555866be373 Mon Sep 17 00:00:00 2001
From: chris48s <chris48s@users.noreply.github.com>
Date: Wed, 13 Dec 2023 19:54:21 +0000
Subject: [PATCH] improve documentation for [dynamicxml] service (#9798)

---
 services/dynamic/dynamic-xml.service.js | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

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: `<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',
           },
-- 
GitLab