[asterisk-bugs] [JIRA] (ASTERISK-29791) xmldoc: Dump invalid to XML DTD: ACO Matchfield
Alexander Traud (JIRA)
noreply at issues.asterisk.org
Mon Dec 6 07:33:34 CST 2021
[ https://issues.asterisk.org/jira/browse/ASTERISK-29791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander Traud updated ASTERISK-29791:
---------------------------------------
Description:
After {{./configure --enable-xmldoc}}, the command-line interface (CLI) offers {{xmldoc dump <file>}} since Asterisk 12. Although {{make full}} calls the sub-target {{make validate-docs}}, just the static XML file is validated. Nobody, not even the script {{tests/CI/publishAsteriskDocs.sh}}, validated the runtime XML file against its DTD:
{code}
xmllint --noout --dtdvalid doc/appdocsxml.dtd <file>
xmlstarlet val --err --dtd doc/appdocsxml.dtd <file>
{code}
gives something like
{code}
Element matchInfo content does not follow the DTD, expecting (category | field?), got (category field)
match="false">^general$</category><field name="
{code}
The cause are all modules which use ACO {{matchfield}}. Those are
* {{apps/confbridge/conf_config_parser.c}} and
* {{res/ari/config.c}} (introduced with commit [684481b|https://github.com/asterisk/asterisk/commit/684481b]).
I considered to simply remove the {{category_match}} because a {{matchfield}} is sufficient for a match. However, {{main/config_options.c:internal_aco_type_find(.)}} requires a category always. Therefore, I changed my approach and changed the DTD from an alternative to a sequence, still with the second XML element optional.
This issue was introduced in Feb. 2013 with the addition of the [CLI configuration documentation|https://github.com/asterisk/asterisk/commit/d04ab3c] itself. In other words: Since day one, this never worked. In other words: The XML never validated. Looking at that, what about validating the runtime XML in {{tests/CI/publishAsteriskDocs.sh}}?
was:
After {{./configure --enable-xmldoc}}, the command-line interface (CLI) offers {{xmldoc dump <file>}} since Asterisk 12. Although {{make full}} calls the sub-target {{make validate-docs}}, just the static XML file is validated. Nobody, not even the script {{tests/CI/publishAsteriskDocs.sh}}, validated the runtime XML file against its DTD:
{code}
xmllint --noout --dtdvalid doc/appdocsxml.dtd <file>
xmlstarlet val --err --dtd doc/appdocsxml.dtd <file>
{code}
gives something like
{code}
Element matchInfo content does not follow the DTD, expecting (category | field?), got (category field)
match="false">^general$</category><field name="
{code}
The cause are all modules which use ACO {{matchfield}}. Those are
* {{apps/confbridge/conf_config_parser.c}} and
* {{res/ari/config.c}}.
I considered to simply remove the {{category_match}} because a {{matchfield}} is sufficient for a match. However, {{main/config_options.c:internal_aco_type_find(.)}} requires a category always. Therefore, I changed my approach and changed the DTD from an alternative to a sequence, still with the second XML element optional.
This issue was introduced in Feb. 2013 with the addition of the [CLI configuration documentation|https://github.com/asterisk/asterisk/commit/d04ab3c] itself. In other words: Since day one, this never worked. In other words: The XML never validated. Looking at that, what about validating the runtime XML in {{tests/CI/publishAsteriskDocs.sh}}?
> xmldoc: Dump invalid to XML DTD: ACO Matchfield
> -----------------------------------------------
>
> Key: ASTERISK-29791
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-29791
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Documentation
> Affects Versions: 16.22.0, 18.8.0, 19.0.0
> Reporter: Alexander Traud
> Assignee: Alexander Traud
>
> After {{./configure --enable-xmldoc}}, the command-line interface (CLI) offers {{xmldoc dump <file>}} since Asterisk 12. Although {{make full}} calls the sub-target {{make validate-docs}}, just the static XML file is validated. Nobody, not even the script {{tests/CI/publishAsteriskDocs.sh}}, validated the runtime XML file against its DTD:
> {code}
> xmllint --noout --dtdvalid doc/appdocsxml.dtd <file>
> xmlstarlet val --err --dtd doc/appdocsxml.dtd <file>
> {code}
> gives something like
> {code}
> Element matchInfo content does not follow the DTD, expecting (category | field?), got (category field)
> match="false">^general$</category><field name="
> {code}
> The cause are all modules which use ACO {{matchfield}}. Those are
> * {{apps/confbridge/conf_config_parser.c}} and
> * {{res/ari/config.c}} (introduced with commit [684481b|https://github.com/asterisk/asterisk/commit/684481b]).
> I considered to simply remove the {{category_match}} because a {{matchfield}} is sufficient for a match. However, {{main/config_options.c:internal_aco_type_find(.)}} requires a category always. Therefore, I changed my approach and changed the DTD from an alternative to a sequence, still with the second XML element optional.
> This issue was introduced in Feb. 2013 with the addition of the [CLI configuration documentation|https://github.com/asterisk/asterisk/commit/d04ab3c] itself. In other words: Since day one, this never worked. In other words: The XML never validated. Looking at that, what about validating the runtime XML in {{tests/CI/publishAsteriskDocs.sh}}?
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list