Browse Source

Use new XML ns for examples

Serj Kalichev 1 year ago
parent
commit
13abb7a8d4

+ 3 - 1
docs/klish3.ru.md

@@ -342,7 +342,9 @@ SEQ сам может быть элементом контейнера SWITCH.
 </KLISH>
 </KLISH>
 ```
 ```
 
 
-Описани
+Заголовок вводит свое пространство имен XML по умолчанию
+"https://klish.libcode.org/klish3". Заголовок стардартный и чаще всего нет смысла
+его менять.
 
 
 
 
 ### PLUGIN
 ### PLUGIN

+ 3 - 3
examples/lua/lua1.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <KLISH
 <KLISH
-    xmlns="http://clish.sourceforge.net/XMLSchema"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema http://clish.sourceforge.net/XMLSchema/clish.xsd">
+	xmlns="https://klish.libcode.org/klish3"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
 
 
 <PLUGIN name="klish"/>
 <PLUGIN name="klish"/>
 
 

+ 2 - 2
examples/simple/example.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <KLISH
 <KLISH
-	xmlns="http://clish.sourceforge.net/XMLSchema"
+	xmlns="https://klish.libcode.org/klish3"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema http://clish.sourceforge.net/XMLSchema/clish.xsd">
+	xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
 
 
 <PLUGIN name="klish"/>
 <PLUGIN name="klish"/>
 
 

+ 24 - 25
examples/test/entry.xml

@@ -1,31 +1,30 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-
-<!-- klish-3.0.0 XML config example -->
-
 <KLISH
 <KLISH
-	xmlns="http://clish.sourceforge.net/XMLSchema"
+	xmlns="https://klish.libcode.org/klish3"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema http://clish.sourceforge.net/XMLSchema/clish.xsd">
+	xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
+
+<!-- klish-3.0.0 XML config example -->
 
 
 <!-- VIEW. Views are not visible for path. Switch because you must choose one of the commands -->
 <!-- VIEW. Views are not visible for path. Switch because you must choose one of the commands -->
-<ENTRY name="main" mode="switch" ptype="STRING" container="true">
+<ENTRY name="main" mode="switch" container="true">
 
 
   <!-- COMMAND -->
   <!-- COMMAND -->
   <ENTRY name="cmd" help="Clear settings" mode="sequence">
   <ENTRY name="cmd" help="Clear settings" mode="sequence">
     <!-- SWITCH container. Container is not visible while CLI session -->
     <!-- SWITCH container. Container is not visible while CLI session -->
-    <ENTRY name="opt" help="Switch subcommand" ptype="STRING" mode="switch" container="true">
+    <ENTRY name="opt" help="Switch subcommand" mode="switch" container="true">
       <!-- PARAMs (switched) -->
       <!-- PARAMs (switched) -->
-      <ENTRY name="o1" ptype="COMMAND" help="Clear callerid_number_prepend assignment" />
-      <ENTRY name="o2" ptype="COMMAND" help="Clear record assignment" />
-      <ENTRY name="o3" ptype="COMMAND" help="Clear callerid assignment" />
-      <ENTRY name="o4" ptype="COMMAND" help="Clear a schedule">
+      <ENTRY name="o1" help="Clear callerid_number_prepend assignment" />
+      <ENTRY name="o2" help="Clear record assignment" />
+      <ENTRY name="o3" help="Clear callerid assignment" />
+      <ENTRY name="o4" help="Clear a schedule">
         <!-- subPARAM -->
         <!-- subPARAM -->
-        <ENTRY name="o5" help="Include number" ptype="UINT" optional="false" completion="${POSSIBLE_TRUNK_GROUP_INCLUDES}">
+        <ENTRY name="o5" help="Include number">
         </ENTRY>
         </ENTRY>
       </ENTRY>
       </ENTRY>
-      <ENTRY name="o6" ptype="COMMAND" help="Clear callerid_number_remove assignment" />
-      <ENTRY name="o7" ptype="COMMAND" help="Clear callerid_number_postpend assignment" />
-      <ENTRY name="o8" ptype="COMMAND" help="Clear callerid_number_replace assignment" />
+      <ENTRY name="o6" help="Clear callerid_number_remove assignment" />
+      <ENTRY name="o7" help="Clear callerid_number_postpend assignment" />
+      <ENTRY name="o8" help="Clear callerid_number_replace assignment" />
 
 
     </ENTRY>
     </ENTRY>
 
 
@@ -37,11 +36,11 @@
 
 
 
 
   <!-- Another COMMAND. Sequence means that all subENTRYes can be entered simultaneously -->
   <!-- Another COMMAND. Sequence means that all subENTRYes can be entered simultaneously -->
-  <ENTRY name="cmd1" help="Clear settings" mode="sequence" ptype="STRING" purpose="common">
+  <ENTRY name="cmd1" help="Clear settings" mode="sequence" purpose="common">
 	<!-- PTYPE. Special purpose=ptype. Link to previosly defined "COMMAND" PTYPE -->
 	<!-- PTYPE. Special purpose=ptype. Link to previosly defined "COMMAND" PTYPE -->
 	<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
 	<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
 	<!-- COND. Conditional expression. Is parent COMMAND visible? -->
 	<!-- COND. Conditional expression. Is parent COMMAND visible? -->
-	<ENTRY name="o2" ptype="COMMAND" purpose="cond"/>
+	<ENTRY name="o2" purpose="cond"/>
 
 
 	<ENTRY name="o1" help="Clear callerid_number_prepend assignment">
 	<ENTRY name="o1" help="Clear callerid_number_prepend assignment">
 		<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
 		<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
@@ -51,14 +50,14 @@
 	</ENTRY>
 	</ENTRY>
 
 
     <!-- Conditional ACTIONs -->
     <!-- Conditional ACTIONs -->
-    <ACTION sym="tsym" exec_on="always" ptype="STRING">0</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING">1</ACTION>
-    <ACTION sym="tsym" exec_on="fail" ptype="STRING">2</ACTION>
-    <ACTION sym="tsym" exec_on="never" ptype="STRING">3</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING" sync="true">4</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING"></ACTION>
-    <ACTION sym="tsym" exec_on="success" ptype="STRING">5</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING">6</ACTION>
+    <ACTION sym="tsym" exec_on="always">0</ACTION>
+    <ACTION sym="tsym" exec_on="always">1</ACTION>
+    <ACTION sym="tsym" exec_on="fail">2</ACTION>
+    <ACTION sym="tsym" exec_on="never">3</ACTION>
+    <ACTION sym="tsym" exec_on="always" sync="true">4</ACTION>
+    <ACTION sym="tsym" exec_on="always"></ACTION>
+    <ACTION sym="tsym" exec_on="success">5</ACTION>
+    <ACTION sym="tsym" exec_on="always">6</ACTION>
   </ENTRY>
   </ENTRY>
 
 
 
 

+ 2 - 4
examples/test/ptypes.xml

@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-
 <KLISH
 <KLISH
-	xmlns="http://clish.sourceforge.net/XMLSchema"
+	xmlns="https://klish.libcode.org/klish3"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema http://clish.sourceforge.net/XMLSchema/clish.xsd">
-
+	xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
 
 
 <PTYPE name="COMMAND">
 <PTYPE name="COMMAND">
 	<COMPL>
 	<COMPL>

+ 24 - 25
examples/test/schema.xml

@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Test for Juniper-like scheme -->
-
 <KLISH
 <KLISH
-	xmlns="http://clish.sourceforge.net/XMLSchema"
+	xmlns="https://klish.libcode.org/klish3"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema http://clish.sourceforge.net/XMLSchema/clish.xsd">
+	xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
+
+<!-- Test for Juniper-like scheme -->
 
 
 <ENTRY name="schema" mode="switch" container="true">
 <ENTRY name="schema" mode="switch" container="true">
 
 
@@ -41,24 +40,24 @@
 
 
 
 
 <!-- VIEW. Views are not visible for path. Switch because you must choose one of the commands -->
 <!-- VIEW. Views are not visible for path. Switch because you must choose one of the commands -->
-<ENTRY name="main" mode="switch" ptype="STRING" container="true">
+<ENTRY name="main" mode="switch" container="true">
 
 
   <!-- COMMAND -->
   <!-- COMMAND -->
   <ENTRY name="cmd" help="Clear settings" mode="sequence">
   <ENTRY name="cmd" help="Clear settings" mode="sequence">
     <!-- SWITCH container. Container is not visible while CLI session -->
     <!-- SWITCH container. Container is not visible while CLI session -->
-    <ENTRY name="opt" help="Switch subcommand" ptype="STRING" mode="switch" container="true">
+    <ENTRY name="opt" help="Switch subcommand" mode="switch" container="true">
       <!-- PARAMs (switched) -->
       <!-- PARAMs (switched) -->
-      <ENTRY name="o1" ptype="COMMAND" help="Clear callerid_number_prepend assignment" />
-      <ENTRY name="o2" ptype="COMMAND" help="Clear record assignment" />
-      <ENTRY name="o3" ptype="COMMAND" help="Clear callerid assignment" />
-      <ENTRY name="o4" ptype="COMMAND" help="Clear a schedule">
+      <ENTRY name="o1" help="Clear callerid_number_prepend assignment" />
+      <ENTRY name="o2" help="Clear record assignment" />
+      <ENTRY name="o3" help="Clear callerid assignment" />
+      <ENTRY name="o4" help="Clear a schedule">
         <!-- subPARAM -->
         <!-- subPARAM -->
-        <ENTRY name="o5" help="Include number" ptype="UINT" optional="false" completion="${POSSIBLE_TRUNK_GROUP_INCLUDES}">
+        <ENTRY name="o5" help="Include number">
         </ENTRY>
         </ENTRY>
       </ENTRY>
       </ENTRY>
-      <ENTRY name="o6" ptype="COMMAND" help="Clear callerid_number_remove assignment" />
-      <ENTRY name="o7" ptype="COMMAND" help="Clear callerid_number_postpend assignment" />
-      <ENTRY name="o8" ptype="COMMAND" help="Clear callerid_number_replace assignment" />
+      <ENTRY name="o6" help="Clear callerid_number_remove assignment" />
+      <ENTRY name="o7" help="Clear callerid_number_postpend assignment" />
+      <ENTRY name="o8" help="Clear callerid_number_replace assignment" />
 
 
     </ENTRY>
     </ENTRY>
 
 
@@ -70,11 +69,11 @@
 
 
 
 
   <!-- Another COMMAND. Sequence means that all subENTRYes can be entered simultaneously -->
   <!-- Another COMMAND. Sequence means that all subENTRYes can be entered simultaneously -->
-  <ENTRY name="cmd1" help="Clear settings" mode="sequence" ptype="STRING" purpose="common">
+  <ENTRY name="cmd1" help="Clear settings" mode="sequence" purpose="common">
 	<!-- PTYPE. Special purpose=ptype. Link to previosly defined "COMMAND" PTYPE -->
 	<!-- PTYPE. Special purpose=ptype. Link to previosly defined "COMMAND" PTYPE -->
 	<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
 	<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
 	<!-- COND. Conditional expression. Is parent COMMAND visible? -->
 	<!-- COND. Conditional expression. Is parent COMMAND visible? -->
-	<ENTRY name="o2" ptype="COMMAND" purpose="cond"/>
+	<ENTRY name="o2" purpose="cond"/>
 
 
 	<ENTRY name="o1" help="Clear callerid_number_prepend assignment">
 	<ENTRY name="o1" help="Clear callerid_number_prepend assignment">
 		<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
 		<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
@@ -84,14 +83,14 @@
 	</ENTRY>
 	</ENTRY>
 
 
     <!-- Conditional ACTIONs -->
     <!-- Conditional ACTIONs -->
-    <ACTION sym="tsym" exec_on="always" ptype="STRING">0</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING">1</ACTION>
-    <ACTION sym="tsym" exec_on="fail" ptype="STRING">2</ACTION>
-    <ACTION sym="tsym" exec_on="never" ptype="STRING">3</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING" sync="true">4</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING"></ACTION>
-    <ACTION sym="tsym" exec_on="success" ptype="STRING">5</ACTION>
-    <ACTION sym="tsym" exec_on="always" ptype="STRING">6</ACTION>
+    <ACTION sym="tsym" exec_on="always">0</ACTION>
+    <ACTION sym="tsym" exec_on="always">1</ACTION>
+    <ACTION sym="tsym" exec_on="fail">2</ACTION>
+    <ACTION sym="tsym" exec_on="never">3</ACTION>
+    <ACTION sym="tsym" exec_on="always" sync="true">4</ACTION>
+    <ACTION sym="tsym" exec_on="always"></ACTION>
+    <ACTION sym="tsym" exec_on="success">5</ACTION>
+    <ACTION sym="tsym" exec_on="always">6</ACTION>
   </ENTRY>
   </ENTRY>
 
 
 
 

+ 2 - 4
plugins/klish/xml/ptypes.xml

@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-
 <KLISH
 <KLISH
-	xmlns="http://clish.sourceforge.net/XMLSchema"
+	xmlns="https://klish.libcode.org/klish3"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema http://clish.sourceforge.net/XMLSchema/clish.xsd">
-
+	xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
 
 
 <PTYPE name="COMMAND">
 <PTYPE name="COMMAND">
 	<COMPL>
 	<COMPL>