Logo Search packages:      
Sourcecode: jing-trang version File versions  Download package

void com::thaiopensource::validate::nvdl::SchemaImpl::Handler::parseRule ( String  ns,
Attributes  attributes 
) throws SAXException [inline, private]

Parse namespace and anyNamespace rules/

Parameters:
ns The namespace, #any for anyNamespace
attributes The rule attributes.
Exceptions:
SAXException 

Definition at line 622 of file SchemaImpl.java.

References com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::actions, com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::attributeActions, com::thaiopensource::validate::nvdl::ElementsOrAttributes::containsAttributes(), com::thaiopensource::validate::nvdl::ElementsOrAttributes::containsElements(), com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::currentMode, error(), com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::match, md, and toElementsOrAttributes().

Referenced by parseAnyNamespace(), and parseNamespace().

                                                                                 {
      // gets the value of the match attribute, defaults to match elements only.
      md.match = toElementsOrAttributes(attributes.getValue("", "match"),
                                        ElementsOrAttributes.ELEMENTS);
      String wildcard = attributes.getValue("", "wildCard");
      if (wildcard == null) {
        wildcard = NamespaceSpecification.DEFAULT_WILDCARD;
      }
      
      // check if match attributes
      if (md.match.containsAttributes()) {
        // creates an empty attributes action set.
        md.attributeActions = new AttributeActionSet();
        // if we already have attribute actions for this namespace 
        // signal an error.
        if (!md.currentMode.bindAttribute(ns, wildcard, md.attributeActions)) {
          if (ns.equals(NamespaceSpecification.ANY_NAMESPACE))
            error("duplicate_attribute_action_any_namespace");
          else
            error("duplicate_attribute_action", ns);
        }
      }
      else
        md.attributeActions = null;
      // XXX: george // } else md.attributeActions=null; //???
      
      // check if match elements
      if (md.match.containsElements()) {
        // creates an empty action set.
        md.actions = new ActionSet();
        // if we already have actions for this namespace 
        // signal an error.
        if (!md.currentMode.bindElement(ns, wildcard, md.actions)) {
          if (ns.equals(NamespaceSpecification.ANY_NAMESPACE))
            error("duplicate_element_action_any_namespace");
          else
            error("duplicate_element_action", ns);
        }
      }
      else
        md.actions = null;
    }


Generated by  Doxygen 1.6.0   Back to index