Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.0

Request #16332 Add support for optional arguments in XML
Submitted: 2009-06-16 00:47 UTC Modified: 2009-06-16 08:06 UTC
From: gauthierm Assigned: izi
Status: Closed Package: Console_CommandLine (version CVS)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  



Patch xml-optional-arguments Revisions
Revision 2009-06-16 00:47 UTC
Developer gauthierm
 
Download patch

Index: Console/CommandLine/XmlParser.php
===================================================================
RCS file: /repository/pear/Console_CommandLine/Console/CommandLine/XmlParser.php,v
retrieving revision 1.2
diff -u -r1.2 XmlParser.php
--- Console/CommandLine/XmlParser.php	8 Jun 2009 12:58:39 -0000	1.2
+++ Console/CommandLine/XmlParser.php	15 Jun 2009 23:47:33 -0000
@@ -233,6 +233,9 @@
             case 'multiple':
                 $obj->multiple = self::_bool(trim($cNode->nodeValue));
                 break;
+            case 'optional':
+                $obj->optional = self::_bool(trim($cNode->nodeValue));
+                break;
             default:
                 break;
             }
Index: data/xmlschema.rng
===================================================================
RCS file: /repository/pear/Console_CommandLine/data/xmlschema.rng,v
retrieving revision 1.5
diff -u -r1.5 xmlschema.rng
--- data/xmlschema.rng	8 Jun 2009 12:58:39 -0000	1.5
+++ data/xmlschema.rng	15 Jun 2009 23:47:33 -0000
@@ -166,6 +166,11 @@
             <ref name="ref_bool_choices"/>
           </element>
         </optional>
+        <optional>
+          <element name="optional">
+            <ref name="ref_bool_choices"/>
+          </element>
+        </optional>
       </interleave>
     </element>
   </define>