Improve dtd for ADML services
authorEduardo Ramos Testillano (eramedu) <eduardo.ramos.testillano@ericsson.com>
Mon, 4 May 2020 17:38:50 +0000 (19:38 +0200)
committerEduardo Ramos Testillano (eramedu) <eduardo.ramos.testillano@ericsson.com>
Mon, 4 May 2020 17:38:50 +0000 (19:38 +0200)
As ADML services loader is retrieving stacks and then nodes,
there is no need to fix strict order for those elements.
Dtd must be relaxed to accept nodes and then stacks.

This is necessary because some json to xml converters could
add xml elements in alphabetical order (and then, stacks is
after node).

example/diameter/launcher/Launcher.cpp
example/diameter/launcher/resources/services_examples/services.dtd

index 60a9cb0..1940402 100644 (file)
@@ -48,7 +48,7 @@ const char *ServicesDTD = "\
 <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
 <!-- Diameter services DTD -->\n\
 \n\
-<!ELEMENT services (stack*, node*)>\n\
+<!ELEMENT services ((stack*, node*)|(node*, stack*))>\n\
 \n\
 <!ELEMENT stack EMPTY>\n\
 <!ATTLIST stack id CDATA #REQUIRED dictionary CDATA #REQUIRED validationMode (BeforeEncoding | AfterDecoding | Always | Never) #IMPLIED validationDepth (Complete | FirstError) #IMPLIED fixMode (BeforeEncoding | AfterDecoding | Always | Never) #IMPLIED ignoreFlagsOnValidation (yes | no) #IMPLIED>\n\
index 3413e1f..0f3e73c 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Diameter services DTD -->
 
-<!ELEMENT services (stack*, node*)>
+<!ELEMENT services ((stack*, node*)|(node*, stack*))>
 
 <!ELEMENT stack EMPTY>
 <!ATTLIST stack id CDATA #REQUIRED dictionary CDATA #REQUIRED validationMode (BeforeEncoding | AfterDecoding | Always | Never) #IMPLIED validationDepth (Complete | FirstError) #IMPLIED fixMode (BeforeEncoding | AfterDecoding | Always | Never) #IMPLIED ignoreFlagsOnValidation (yes | no) #IMPLIED>