code: public static void main(String[] args) {
          if (args.length != 1) {
              fail("One argument required: /path/to/xacml-policy-to-validate.xml");
          }
          final String schemaPathProperty = "com.sun.xacml.PolicySchema";
          String schemaPath = System.getProperty(schemaPathProperty);
          if (schemaPath == null) {
              fail("System property " + schemaPathProperty + " (path to XACML "
                   + "schema) must be set. (e.g. -D" + schemaPathProperty
                   + "=/path/to/schema)");
          }
          try {
              InputStream instance = getStream(args[0]);
              PolicyParser parser = new PolicyParser(getStream(schemaPath));
              parser.parse(instance, true);
              System.out.println("Validation successful");
              System.exit(0);
          } catch (ValidationException e) {
              if (e.getCause() != null && e.getCause() instanceof SAXParseException) {
                  fail(e.getCause().getMessage());
              } else {
                  fail(e);
              }
          } catch (Exception e) {
              fail(e);
          }
      }
docs: Command-line utility for validating XACML policies.
  <p>
  Accepts a single argument: the path to the policy instance to validate.
  <p>
  Also requires that the com.sun.xacml.PolicySchema system property points
  to the XACML schema.