]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
xmldoc: Fix issue with xmlstarlet validation
authorGeorge Joseph <gjoseph@digium.com>
Tue, 1 Mar 2022 16:58:44 +0000 (09:58 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 1 Mar 2022 16:58:44 +0000 (09:58 -0700)
Added the missing xml-stylesheet and Xinclude namespace
declarations in pjsip_config.xml and pjsip_manager.xml.

Updated make_xml_documentation to show detailed errors when
xmlstarlet is the validator.  It's now run once with the '-q'
option to suppress harmless/expected messages and if it actually
fails, it's run again without '-q' but with '-e' to show
the actual errors.

Change-Id: I4bdc9d2ea6741e8d2e5eb82df60c68ccc59e1f5e

build_tools/make_xml_documentation
res/res_pjsip/pjsip_config.xml
res/res_pjsip/pjsip_manager.xml

index fafb81c376e10da9adb82e400ce18db5570847a6..54144ce8a7437d155aefb416eb67290a1337b4e2 100755 (executable)
@@ -224,7 +224,8 @@ for subdir in ${mod_subdirs} ; do
                        if [ "${XMLLINT}" != ":" ] ; then
                                ${XMLLINT} --dtdvalid "${source_tree}/doc/appdocsxml.dtd" --path "${source_tree}/doc" --noout "${i}" || { echo "" ; exit 1 ; }
                        else
-                               ${XMLSTARLET} val -d "${source_tree}/doc/appdocsxml.dtd" "${i}" || { echo "" ; exit 1 ; }
+                               ${XMLSTARLET} val -q -d "${source_tree}/doc/appdocsxml.dtd" "${i}" ||
+                                       ${XMLSTARLET} val -e -d "${source_tree}/doc/appdocsxml.dtd" "${i}" || { echo "" ; exit 1 ; }
                        fi
                fi
                ${SED} -r "/^\s*(<[?]xml|<.DOCTYPE|<.?docs)/d" "${i}" >> "${output_file}"
@@ -241,7 +242,8 @@ if [ "${validate}" -eq "1" ] ;then
        if [ "${XMLLINT}" != ":" ] ; then
                ${XMLLINT} --dtdvalid "${source_tree}/doc/appdocsxml.dtd" --path "${source_tree}/doc" --noout "${output_file}" || exit 1
        else
-               ${XMLSTARLET} val -d "${source_tree}/doc/appdocsxml.dtd" "${output_file}" || exit 1
+               ${XMLSTARLET} val -q -d "${source_tree}/doc/appdocsxml.dtd" "${output_file}" ||
+                       ${XMLSTARLET} val -e -d "${source_tree}/doc/appdocsxml.dtd" "${output_file}" || { echo "" ; exit 1 ; }
        fi
 fi
 
index c51c64462230dfa91ea5583b0df8a83186b55332..6470ab6b4d7daa1fe22c928e353ecc9f2624d46c 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE docs SYSTEM "appdocsxml.dtd">
-<docs>
+<?xml-stylesheet type="text/xsl" href="appdocsxml.xslt"?>
+<docs xmlns:xi="http://www.w3.org/2001/XInclude">
        <configInfo name="res_pjsip" language="en_US">
                <synopsis>SIP Resource using PJProject</synopsis>
                <configFile name="pjsip.conf">
index a0047aaf9783f280746ac9fe2e50309ed4a28e76..810a5e3ec455d3a34fe2bc4e1aba2900ea0cff42 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE docs SYSTEM "appdocsxml.dtd">
-<docs>
+<?xml-stylesheet type="text/xsl" href="appdocsxml.xslt"?>
+<docs xmlns:xi="http://www.w3.org/2001/XInclude">
        <manager name="PJSIPQualify" language="en_US">
                <synopsis>
                        Qualify a chan_pjsip endpoint.