Commits

Anonymous committed 2e293bc

XW-192: Created a 1.0.2 version of the xwork-validator.dtd with short-circuit attributes

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@294e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (7)

 <?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true">
+<module version="4" relativePaths="true" type="JAVA_MODULE">
   <component name="LvcsConfiguration">
     <option name="LOCAL_VCS_ENABLED" value="false" />
     <option name="LOCAL_VCS_PURGING_PERIOD" value="259200000" />
         <SOURCES />
       </library>
     </orderEntry>
+    <orderEntry type="library" name="xalan" level="application" />
+    <orderEntry type="library" name="xerces" level="application" />
+    <orderEntry type="library" name="xml-apis" level="application" />
+    <orderEntryProperties />
   </component>
 </module>
 

src/etc/xwork-validator-1.0.2.dtd

+<?xml version="1.0" encoding="UTF-8"?>
+<!ELEMENT validators (field*,validator*)>
+
+<!ELEMENT field (field-validator+)>
+<!ATTLIST field
+	name CDATA #REQUIRED
+>
+
+<!ELEMENT field-validator (param*, message)>
+<!ATTLIST field-validator
+	type CDATA #REQUIRED
+    short-circuit (true|false) "false"
+>
+
+<!ELEMENT validator (param*, message)>
+<!ATTLIST validator
+	type CDATA #REQUIRED
+    short-circuit (true|false) "false"
+>
+
+<!ELEMENT param (#PCDATA)>
+<!ATTLIST param
+    name CDATA #REQUIRED
+>
+
+<!ELEMENT message (#PCDATA)>
+<!ATTLIST message
+    key CDATA #IMPLIED
+>
+
+

src/etc/xwork-validator-1.0.dtd

 <!ELEMENT field-validator (param*, message)>
 <!ATTLIST field-validator
 	type CDATA #REQUIRED
-    short-circuit (true|false) "false"
 >
 
 <!ELEMENT validator (param*, message)>
 <!ATTLIST validator
 	type CDATA #REQUIRED
-    short-circuit (true|false) "false"
 >
 
 <!ELEMENT param (#PCDATA)>

src/java/com/opensymphony/xwork/validator/ValidatorFileParser.java

             DocumentBuilder builder = dbf.newDocumentBuilder();
             builder.setEntityResolver(new EntityResolver() {
                     public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
-                        if ("-//OpenSymphony Group//XWork Validator 1.0//EN".equals(publicId)) {
-                            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+                        ClassLoader loader = Thread.currentThread().getContextClassLoader();
 
+                        if ("-//OpenSymphony Group//XWork Validator 1.0//EN".equals(publicId)) {
                             return new InputSource(loader.getResourceAsStream("xwork-validator-1.0.dtd"));
+                        } else if ("-//OpenSymphony Group//XWork Validator 1.0.2//EN".equals(publicId)) {
+                            return new InputSource(loader.getResourceAsStream("xwork-validator-1.0.2.dtd"));
                         }
 
                         return null;

src/test/com/opensymphony/xwork/test/User-validation.xml

-<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
 <validators>
     <field name="name">
         <field-validator type="required">

src/test/com/opensymphony/xwork/test/UserMarker-validation.xml

-<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
 <validators>
     <field name="email">
         <field-validator type="required" short-circuit="true">

src/test/com/opensymphony/xwork/validator/validator-parser-test.xml

-<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
 <validators>
     <field name="foo">
         <field-validator type="required">