--- build_tools/make_xml_documentation.orig	2026-04-10 06:10:07 UTC
+++ build_tools/make_xml_documentation
@@ -218,7 +218,7 @@ for subdir in ${mod_subdirs} ; do
 			mn=${bn%%.*}
 		fi
 		# Set the module name on specific elements
-		${SED} -r -e "s/<(manager|managerEvent|managerEventInstance|function|application|info)\s+([^>]+)>/<\1 \2 module=\"${mn}\">/g" /tmp/xmldoc.tmp.xml >> "${output_file}"
+		${SED} -r -e "s/<(manager|managerEvent|managerEventInstance|function|application|info)[[:space:]]+([^>]+)>/<\1 \2 module=\"${mn}\">/g" /tmp/xmldoc.tmp.xml >> "${output_file}"
 	done
 	for i in $(${FIND} "${subdir_path}" -name '*.xml') ; do
 		${GREP} -q "appdocsxml.dtd" "${i}" || continue
@@ -230,13 +230,13 @@ for subdir in ${mod_subdirs} ; do
 					${XMLSTARLET} val -e -d "${source_tree}/doc/appdocsxml.dtd" "${i}" || { echo "" ; exit 1 ; }
 			fi
 		fi
-		${SED} -r "/^\s*(<[?]xml|<.DOCTYPE|<.?docs)/d" "${i}" > /tmp/xmldoc.tmp.xml
+		${SED} -r "/^[[:space:]]*(<[?]xml|<.DOCTYPE|<.?docs)/d" "${i}" > /tmp/xmldoc.tmp.xml
 		dirname=${i%/*}
 		if [ "${dirname}" != "${subdir_path}" ] ; then
 			# If we're in a subdirectory like channels/pjsip, we need to check channels/Makefile
 			# to see which module xml files in this directory belong to.
 			bn=${dirname##*/}
-			mn=$(${SED} -n -r -e "s/^[$]\(call MOD_ADD_C,([^,]+),[$]\(wildcard\s+${bn}\/.*/\1/gp" "${subdir_path}/Makefile")
+			mn=$(${SED} -n -r -e "s/^[$]\(call MOD_ADD_C,([^,]+),[$]\(wildcard[[:space:]]+${bn}\/.*/\1/gp" "${subdir_path}/Makefile")
 		else
 			if [ "${subdir}" = "main" ] ; then
 				# Force the module to be "builtin" if the XML is in the main directory.
@@ -249,7 +249,7 @@ for subdir in ${mod_subdirs} ; do
 			fi
 		fi
 		# Set the module name on specific elements
-		${SED} -r -e "s/<(manager|managerEvent|managerEventInstance|function|application|info)\s+([^>]+)>/<\1 \2 module=\"${mn}\">/g" /tmp/xmldoc.tmp.xml >> "${output_file}"
+		${SED} -r -e "s/<(manager|managerEvent|managerEventInstance|function|application|info)[[:space:]]+([^>]+)>/<\1 \2 module=\"${mn}\">/g" /tmp/xmldoc.tmp.xml >> "${output_file}"
 	done
 done
 
@@ -258,7 +258,7 @@ cp "${output_file}" /tmp/xmldoc.tmp.xml
 # Some entries may already have a module attribute so remove the dup.
 # It's easier to do this once on the entire file rather on a source-by-source basis.
 cp "${output_file}" /tmp/xmldoc.tmp.xml
-${SED} -r -e 's/module="([^"]+)"\s+module="([^"]+)">/module="\1">/g' /tmp/xmldoc.tmp.xml > "${output_file}"
+${SED} -r -e 's/module="([^"]+)"[[:space:]]+module="([^"]+)">/module="\1">/g' /tmp/xmldoc.tmp.xml > "${output_file}"
 
 
 if [ "${for_wiki}" -eq "1" ] ; then
