예제 #1
0
 /*
  * Creates the variables element
  */
 private Element createVariablesElement(Document doc, Map<String, String> variables) {
   if (variables == null) {
     return null;
   }
   Element variablesE =
       doc.createElementNS(Schemas.SCHEMA_LATEST.namespace, XMLTags.VARIABLES.getXMLName());
   for (String name : variables.keySet()) {
     Element variableE =
         createElement(
             doc,
             XMLTags.VARIABLE.getXMLName(),
             null,
             new Attribute(XMLAttributes.COMMON_NAME.getXMLName(), name),
             new Attribute(XMLAttributes.COMMON_VALUE.getXMLName(), variables.get(name)));
     variablesE.appendChild(variableE);
   }
   return variablesE;
 }
예제 #2
0
  /** Creates the generic information element corresponding to <define name="genericInformation"> */
  private Element createGenericInformation(Document doc, Map<String, String> info) {
    if (info == null) return null;

    Element el =
        doc.createElementNS(
            Schemas.SCHEMA_LATEST.namespace, XMLTags.COMMON_GENERIC_INFORMATION.getXMLName());

    // <oneOrMore>
    // <ref name="info"/>
    // </oneOrMore>
    for (String name : info.keySet()) {
      Element infoElement =
          createElement(
              doc,
              XMLTags.COMMON_INFO.getXMLName(),
              null,
              new Attribute(XMLAttributes.COMMON_NAME.getXMLName(), name),
              new Attribute(XMLAttributes.COMMON_VALUE.getXMLName(), info.get(name)));
      el.appendChild(infoElement);
    }
    return el;
  }