Writes the given system test definition the form of an XML document.
517697
public void write( SystemInputDef systemInput)
    {
    xmlWriter_.writeDeclaration();

    xmlWriter_
      .element( SYSTEM_TAG)
      .attribute( NAME_ATR, systemInput.getName())
      .content( () ->
        {
        writeAnnotations( systemInput);
        toStream( systemInput.getFunctionInputDefs()).forEach( this::writeFunction);
        })
      .write();
    }
1266130
void writeDocument(OutputStream outStream, Document doc) {
        DOMImplementationRegistry domRegistry = null;
        try {
            domRegistry = DOMImplementationRegistry.newInstance();
        // Fortify Mod: Broaden try block to capture all potential exceptions
        // } catch (Exception e) {
        //    LOGR.warning(e.getMessage());
        // }
        DOMImplementationLS impl = (DOMImplementationLS) domRegistry
                .getDOMImplementation("LS");
        LSSerializer writer = impl.createLSSerializer();
        writer.getDomConfig().setParameter("xml-declaration", false);
        writer.getDomConfig().setParameter("format-pretty-print", true);
        LSOutput output = impl.createLSOutput();
        output.setEncoding("UTF-8");
        output.setByteStream(outStream);
        writer.write(doc, output);
        } catch (Exception e) {
            LOGR.warning(e.getMessage());
        }
    }
1314782
public static void serializeAsXML(Node node, Writer writer) {
        PrintWriter out = new PrintWriter(writer);
        print(node, out);
        out.flush();
    }
578868
def _write(self, text):
        """"""
        spaces = ' ' * (self.indent * self.indentlevel)
        t = spaces + text.strip() + '\n'
        if hasattr(t, 'encode'):
            t = t.encode(self.encoding, 'xmlcharrefreplace')
        self.stream.write(t)
1067725
public void writeEndDocument() throws XMLStreamException {
		try {
			checkPendingATEvents();
			encoder.encodeEndDocument();
			encoder.flush();
		} catch (Exception e) {
			throw new XMLStreamException(e.getLocalizedMessage(), e);
		}
	}
414349
public void xmlWriteOn(FormattedWriter writer) throws IOException  
  {
    super.xmlWriteOn(writer);
    writer.newLine();
    writer.taggedValue("busName", _busName);
    writer.newLine();
    writer.taggedValue("type", _type);
    writer.newLine();
    writer.taggedValue("userIds", _inboundUserid + "," + _outboundUserid);
  }
403519
void xmlWriteOn(FormattedWriter writer) throws IOException 
    {
        writer.newLine();
        writer.startTag(XML_UNSTORED_ITEM_MANAGER);
        writer.indent();
        _list.xmlWriteOn(writer);
        writer.outdent();
        writer.newLine();
        writer.endTag(XML_UNSTORED_ITEM_MANAGER);
    }
1157747
@Override
   public void writeXmlBody(Definition def, Writer out) throws IOException
   {
      writeConnectorVersion(out);

      int indent = 1;
      writeIndent(out, indent);
      out.write("<vendor-name>Red Hat Inc</vendor-name>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("<eis-type>Test RA</eis-type>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("<resourceadapter-version>0.1</resourceadapter-version>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("<resourceadapter>");
      writeEol(out);

      if (def.isUseRa())
      {
         writeIndent(out, indent + 1);
         out.write("<resourceadapter-class>" + def.getRaPackage() + "." +
               def.getRaClass() + "</resourceadapter-class>");
         writeEol(out);
         writeConfigPropsXml(def.getRaConfigProps(), out, indent + 1);
      }

      if (def.isSupportOutbound())
      {
         writeOutbound(def, out, indent + 1);
      }
      if (def.isSupportInbound())
      {
         writeInbound(def, out, indent + 1);
      }

      if (def.isGenAdminObject() && def.getAdminObjects().size() > 0)
      {
         for (int i = 0; i < def.getAdminObjects().size(); i++)
         {
            writeIndent(out, indent + 1);
            out.write("<adminobject>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<adminobject-interface>" + def.getRaPackage() + "." +
                  def.getAdminObjects().get(i).getAdminObjectInterface() + "</adminobject-interface>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<adminobject-class>" + def.getRaPackage() + "." +
                  def.getAdminObjects().get(i).getAdminObjectClass() + "</adminobject-class>");
            writeEol(out);
            writeConfigPropsXml(def.getAdminObjects().get(i).getAoConfigProps(), out, indent + 2);
            writeIndent(out, indent + 1);
            out.write("</adminobject>");
            writeEol(out);
         }
      }

      if (def.getSecurityPermissions() != null && def.getSecurityPermissions().size() > 0)
      {
         for (int i = 0; i < def.getSecurityPermissions().size(); i++)
         {
            writeIndent(out, indent + 1);
            out.write("<security-permission>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<security-permission-spec>" + def.getSecurityPermissions().get(i).getPermissionSpec() +
                  "</security-permission-spec>");
            writeEol(out);
            writeIndent(out, indent + 1);
            out.write("</security-permission>");
            writeEol(out);
         }
      }

      writeIndent(out, indent);
      out.write("</resourceadapter>");
      writeEol(out);
      out.write("</connector>");
      writeEol(out);
   }
844528
@Override
   public void writeXmlBody(Definition def, Writer out) throws IOException
   {
      writeConnectorVersion(out);

      int indent = 1;
      writeIndent(out, indent);
      out.write("<display-name>Display Name</display-name>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("<vendor-name>Red Hat Inc</vendor-name>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("<spec-version>1.0</spec-version>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("<eis-type>Test RA</eis-type>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("<version>0.1</version>");
      writeEol(out);

      writeIndent(out, indent);
      out.write("<resourceadapter>");
      writeEol(out);

      writeOutbound(def, out, indent + 1);

      writeIndent(out, indent);
      out.write("</resourceadapter>");
      writeEol(out);
      out.write("</connector>");
      writeEol(out);
   }
491791
def _writeMzmlChecksum(xmlWriter, outputFile):
    
    sha = hashlib.sha1(outputFile.getvalue())
    sha.update('<fileChecksum>')

    xmlChecksumElement = ETREE.Element('fileChecksum')
    xmlChecksumElement.text = sha.hexdigest()

    xmlWriter.write(xmlChecksumElement, pretty_print=True)
318791
public T writeXml(org.w3c.dom.Node node, boolean format) throws IOException {
        getWorld().getXml().getSerializer().serialize(node, this, format);
        return (T) this;
    }
764806
public void write(boolean skipNonOverrides,
                      boolean withXMLDeclaration,
                      PrintWriter writer) {

        final String indent = "                           ";

        // header
        if (withXMLDeclaration) {
            writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        }
        writer.println("<" + _CONFIG + " xmlns=\"" + BE_SECURITY.uri + "\"");
        writer.println(indent + " xmlns:xsi=\"" + XSI.uri + "\"");
        writer.println(indent + " xsi:schemaLocation=\"" + BE_SECURITY.uri
                + " " + BE_SECURITY1_0.xsdLocation + "\"");

        // default values
        writer.print(indent);
        write(m_defaultConfig, false, skipNonOverrides, writer);
        writer.println(">");

        // fedoraInternalCall-1 and -2
        writeInternalConfig(1,
                            m_internalSSL,
                            m_internalBasicAuth,
                            m_internalUsername,
                            m_internalPassword,
                            m_internalIPList,
                            writer);
        writeInternalConfig(2,
                            Boolean.FALSE,
                            Boolean.FALSE,
                            null,
                            null,
                            m_internalIPList,
                            writer);

        // sDep roles
        Iterator<String> bIter = m_sDepConfigs.keySet().iterator();
        while (bIter.hasNext()) {
            String role = bIter.next();
            ServiceDeploymentRoleConfig bConfig = m_sDepConfigs.get(role);
            write(bConfig, true, skipNonOverrides, writer);
            // per-method roles
            Iterator<String> mIter = bConfig.getMethodConfigs().keySet().iterator();
            while (mIter.hasNext()) {
                String methodName = mIter.next();
                MethodRoleConfig mConfig =
                        bConfig.getMethodConfigs().get(methodName);
                write(mConfig, true, skipNonOverrides, writer);
            }
        }

        // closing element for entire doc
        writer.println("</" + _CONFIG + ">");
    }
1248100
def WriteXml(self, w, option, elementName=None):
		
		if (option == WriteXmlOption.Dirty and not self.IsDirty()):
			return
		if elementName == None:
			x = w.createElement(self.propMoMeta.xmlAttribute)
		else:
			x = w.createElement(elementName)
		if UcsUtils.FindClassIdInMoMetaIgnoreCase(self.classId) != None:
			for at in UcsUtils.GetUcsPropertyMetaAttributeList(self.classId):
				atMeta = UcsUtils.GetUcsPropertyMeta(self.classId, at)
				if (atMeta.access == UcsPropertyMeta.Internal):
					continue
				elif ((option != WriteXmlOption.Dirty) or (
							(atMeta.mask != None) and (self.dirtyMask & atMeta.mask) != 0)):
					if (getattr(self, at) != None):
						x.setAttribute(atMeta.xmlAttribute, getattr(self, at))
		# Adding XtraProperties from object into Xml query document
		for xtraProp in self.__dict__['XtraProperty']:
			x.setAttribute(UcsUtils.WordL(xtraProp), self.__dict__['XtraProperty'][xtraProp])
		x_child = self.childWriteXml(w, option)
		for xc in x_child:
			if (xc != None):
				x.appendChild(xc)
		return x
1323403
def write_xml(self, xmlfile):
        """"""

        xmlfile = self.get_model_path(xmlfile)
        self.logger.info('Writing %s...', xmlfile)
        self.like.writeXml(str(xmlfile))
482885
def write_xml(self, outfile, encoding="UTF-8"):
        """"""
        # we add the media namespace if we see any media items
        if any([key for item in self.items for key in vars(item) if
                key.startswith('media_') and getattr(item, key)]):
            self.rss_attrs["xmlns:media"] = "http://search.yahoo.com/mrss/"
        self.generator = _generator_name
        super(MediaRSS2, self).write_xml(outfile, encoding)
408403
public void xmlWriteOn(FormattedWriter writer) throws IOException  
  {
    writer.newLine();
    writer.startTag("messagingEngineUuid");
    writer.write(messagingEngineUuid.toString());
    writer.endTag("messagingEngineUuid");
  }
1368084
def write_junit(target = self.class.default_target)
      # Open a File Object for IO if target is a string containing a filename or path
      target = File.open(target, 'w') if target.is_a? String

      document = REXML::Document.new
      document << REXML::XMLDecl.new
      testsuites = REXML::Element.new('testsuites')

      id = 0
      events.each do |testsuite_name, testcases|
        testsuite = REXML::Element.new('testsuite')
        testsuite.attributes['name'] = testsuite_name
        testsuite.attributes['tests'] = testcases.length
        testsuite.attributes['errors'] = testcases.select(&:error?).length
        testsuite.attributes['failures'] = testcases.select(&:failure?).length
        testsuite.attributes['skipped'] = testcases.select(&:skipped?).length
        testsuite.attributes['time'] = 0
        testsuite.attributes['timestamp'] = Time.now.strftime('%Y-%m-%dT%H:%M:%S')
        testsuite.attributes['hostname'] = Socket.gethostname
        testsuite.attributes['id'] = id
        testsuite.attributes['package'] = testsuite_name
        testsuite.add_element('properties')
        testcases.each { |r| testsuite.elements << r.to_junit }
        testsuite.add_element('system-out')
        testsuite.add_element('system-err')

        testsuites.elements << testsuite
        id += 1
      end

      document.elements << testsuites
      document.write(target, 2)
    ensure
      target.close if target.is_a? File
    end