Write the specified dataset to the specified writer as xml.
171806
public static void write(IDataSet dataSet, Writer writer) throws DataSetException {
		logger.debug("write(dataSet={}, writer={}) - start", dataSet, writer);
		write(dataSet, writer, null);
	}
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);
    }
531557
public void xmlWriteOn(FormattedWriter writer) throws IOException {

        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd @ HH:mm:ss.SSS");
        String timeNow = dateFormat.format(new Date());
        writer.newLine();
        writer.startTag(XML_CACHE_LOADER);
        writer.indent();

        writer.newLine();
        writer.taggedValue("timeNow", timeNow);
        writer.newLine();
        writer.taggedValue("interval", interval);
        writer.newLine();
        writer.taggedValue("enabled", Boolean.valueOf(enabled));
        writer.newLine();
        writer.taggedValue("maxStreamsPerCycle", maxStreamsPerCycle);
        writer.newLine();
        writer.taggedValue("loaderStartTime", dateFormat.format(new Date(loaderStartTime)));
        writer.newLine();
        writer.taggedValue("loaderStopTime", dateFormat.format(new Date(loaderStopTime)));
        writer.newLine();
        writer.taggedValue("totalStreams", totalStreams);
        writer.newLine();

        for (int i = 0; i < MAX_DIAG_LOG; i++)
        {
            String str =
            "Cycle="
            + i
            + (diagIndex == i ? ":*" : ": ")
            + dateFormat.format(new Date(cycleTime[i]))
            + " streamsLoaded="
            + logStreamsLoaded[i]
            + " duration="
            + logDuration[i];
            writer.taggedValue("info", str);
            writer.newLine();
        }

        writer.startTag(XML_STORED_EXCEPTION);
        if (lastException == null)
        {
            writer.write("No exceptions recorded");
        }
        else
        {
            writer.indent();
            writer.newLine();
            writer.taggedValue("time", new Date(lastExceptionTime));
            writer.outdent();
            writer.write(lastException);
            writer.newLine();
        }
        writer.endTag(XML_STORED_EXCEPTION);

        writer.outdent();
        writer.newLine();
        writer.endTag(XML_CACHE_LOADER);
    }
386198
def write_raw_text_to_files(all_files, urls_path, dataset_split, tmp_dir):
  """"""

  def write_to_file(all_files, urls_path, tmp_dir, filename):
    """"""
    with io.open(
        os.path.join(tmp_dir, filename + ".source"), "w",
        encoding="utf-8") as fstory:
      with io.open(
          os.path.join(tmp_dir, filename + ".target"), "w",
          encoding="utf-8") as fsummary:
        for example in example_generator(all_files, urls_path, sum_token=True):
          story, summary = _story_summary_split(example)
          fstory.write(story + "\n")
          fsummary.write(summary + "\n")

  if dataset_split == problem.DatasetSplit.TRAIN:
    filename = "cnndm.train"
  elif dataset_split == problem.DatasetSplit.EVAL:
    filename = "cnndm.dev"
  else:
    filename = "cnndm.test"

  tf.logging.info("Writing %s" % filename)
  write_to_file(all_files, urls_path, tmp_dir, filename)
606469
protected void xmlWriteChildrenOn(FormattedWriter writer) throws IOException 
    {
        super.xmlWriteChildrenOn(writer);
        if (null != _items)
        {
            _items.xmlWriteChildrenOn(writer, XML_ITEMS);
        }
        if (null != _itemStreams)
        {
            _itemStreams.xmlWriteOn(writer, XML_ITEM_STREAMS);
        }
        if (null != _referenceStreams)
        {
            _referenceStreams.xmlWriteOn(writer, XML_REFERENCE_STREAMS);
        }
    }
1169677
public static void save(final AnnotationMappingInfo xmlInfo, final Writer writer) throws XmlOperateException {
        ArgUtils.notNull(xmlInfo, "xmlInfo");
        ArgUtils.notNull(writer, "writer");
        
        try {
            JAXB.marshal(xmlInfo, writer);
            
        } catch (DataBindingException e) {
            throw new XmlOperateException("fail save xml with JAXB.", e);
        }
        
    }
225791
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    writer.newLine();
    writer.taggedValue("remoteMEUuid", remoteMEUuid);
    writer.newLine();
    writer.taggedValue("streamID", streamID);
    writer.newLine();
    writer.taggedValue("initialData", initialData);
    writer.newLine();
    writer.taggedValue("type", type);
  }
795951
def dump_to_store(dataset, store, writer=None, encoder=None,
                  encoding=None, unlimited_dims=None):
    """"""
    if writer is None:
        writer = ArrayWriter()

    if encoding is None:
        encoding = {}

    variables, attrs = conventions.encode_dataset_coordinates(dataset)

    check_encoding = set()
    for k, enc in encoding.items():
        # no need to shallow copy the variable again; that already happened
        # in encode_dataset_coordinates
        variables[k].encoding = enc
        check_encoding.add(k)

    if encoder:
        variables, attrs = encoder(variables, attrs)

    store.store(variables, attrs, check_encoding, writer,
                unlimited_dims=unlimited_dims)
550036
protected function writeEl(XMLWriter $xml, $data)
    {
        foreach ($data as $key => $value) {
            if (\is_array($value) && !$this->isAssoc($value)) { //numeric array
                foreach ($value as $itemValue) {
                    if (\is_array($itemValue)) {
                        $xml->startElement($key);
                        $itemValue = $this->writeAttr($xml, $itemValue);
                        $this->writeEl($xml, $itemValue);
                        $xml->endElement();
                    } else {
                        $itemValue = $this->writeAttr($xml, $itemValue);
                        $xml->writeElement($key, "$itemValue");
                    }
                }
            } else if (\is_array($value)) { //associative array
                $xml->startElement($key);
                $value = $this->writeAttr($xml, $value);
                $this->writeEl($xml, $value);
                $xml->endElement();
            } else { //scalar
                $value = $this->writeAttr($xml, $value);
                $xml->writeElement($key, "$value");
            }
        }
    }
390415
public void xmlWriteOn(FormattedWriter writer) throws IOException 
    {
        writer.newLine();
        writer.startTag(XML_ITEM_MAP);
        writer.indent();
        for (int i = 0; i < _subMaps.length; i++)
        {
            Iterator iterator = _subMaps[i].values().iterator();
            while (iterator.hasNext())
            {
                writer.newLine();
                AbstractItemLink ail = (AbstractItemLink) iterator.next();
                ail.xmlShortWriteOn(writer);
            }
        }
        writer.outdent();
        writer.newLine();
        writer.endTag(XML_ITEM_MAP);
    }
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)
1206608
protected void storeXaDataSource(XaDataSource xads, XMLStreamWriter writer) throws Exception
   {
      writer.writeStartElement(XML.ELEMENT_XA_DATASOURCE);

      if (xads.getJndiName() != null)
         writer.writeAttribute(XML.ATTRIBUTE_JNDI_NAME,
                               xads.getValue(XML.ATTRIBUTE_JNDI_NAME, xads.getJndiName()));

      if (xads.getId() != null)
         writer.writeAttribute(XML.ATTRIBUTE_ID,
                               xads.getValue(XML.ATTRIBUTE_ID, xads.getId()));

      if (xads.isEnabled() != null && (xads.hasExpression(XML.ATTRIBUTE_ENABLED) ||
                                       !Defaults.ENABLED.equals(xads.isEnabled())))
         writer.writeAttribute(XML.ATTRIBUTE_ENABLED,
                               xads.getValue(XML.ATTRIBUTE_ENABLED, xads.isEnabled().toString()));

      if (xads.isSpy() != null && (xads.hasExpression(XML.ATTRIBUTE_SPY) ||
                                   !Defaults.SPY.equals(xads.isSpy())))
         writer.writeAttribute(XML.ATTRIBUTE_SPY,
                               xads.getValue(XML.ATTRIBUTE_SPY, xads.isSpy().toString()));

      if (xads.isUseCcm() != null && (xads.hasExpression(XML.ATTRIBUTE_USE_CCM) ||
                                      !Defaults.USE_CCM.equals(xads.isUseCcm())))
         writer.writeAttribute(XML.ATTRIBUTE_USE_CCM,
                               xads.getValue(XML.ATTRIBUTE_USE_CCM, xads.isUseCcm().toString()));

      if (xads.isConnectable() != null && (xads.hasExpression(XML.ATTRIBUTE_CONNECTABLE) ||
                                           !Defaults.CONNECTABLE.equals(xads.isConnectable())))
         writer.writeAttribute(XML.ATTRIBUTE_CONNECTABLE,
                               xads.getValue(XML.ATTRIBUTE_CONNECTABLE, xads.isConnectable().toString()));

      if (xads.isTracking() != null)
         writer.writeAttribute(XML.ATTRIBUTE_TRACKING,
                               xads.getValue(XML.ATTRIBUTE_TRACKING, xads.isTracking().toString()));

      if (xads.getXaDataSourceProperty() != null && !xads.getXaDataSourceProperty().isEmpty())
      {
         Iterator<Map.Entry<String, String>> it =
            xads.getXaDataSourceProperty().entrySet().iterator();

         while (it.hasNext())
         {
            Map.Entry<String, String> entry = it.next();

            writer.writeStartElement(XML.ELEMENT_XA_DATASOURCE_PROPERTY);
            writer.writeAttribute(XML.ATTRIBUTE_NAME, entry.getKey());
            writer.writeCharacters(xads.getValue(XML.ELEMENT_XA_DATASOURCE_PROPERTY, entry.getKey(), entry.getValue()));
            writer.writeEndElement();
         }
      }

      if (xads.getXaDataSourceClass() != null)
      {
         writer.writeStartElement(XML.ELEMENT_XA_DATASOURCE_CLASS);
         writer.writeCharacters(xads.getValue(XML.ELEMENT_XA_DATASOURCE_CLASS, xads.getXaDataSourceClass()));
         writer.writeEndElement();
      }

      if (xads.getDriver() != null)
      {
         writer.writeStartElement(XML.ELEMENT_DRIVER);
         writer.writeCharacters(xads.getValue(XML.ELEMENT_DRIVER, xads.getDriver()));
         writer.writeEndElement();
      }

      if (xads.getUrlDelimiter() != null)
      {
         writer.writeStartElement(XML.ELEMENT_URL_DELIMITER);
         writer.writeCharacters(xads.getValue(XML.ELEMENT_URL_DELIMITER, xads.getUrlDelimiter()));
         writer.writeEndElement();
      }

      if (xads.getUrlProperty() != null)
      {
         writer.writeStartElement(XML.ELEMENT_URL_PROPERTY);
         writer.writeCharacters(xads.getValue(XML.ELEMENT_URL_PROPERTY, xads.getUrlProperty()));
         writer.writeEndElement();
      }

      if (xads.getUrlSelectorStrategyClassName() != null)
      {
         writer.writeStartElement(XML.ELEMENT_URL_SELECTOR_STRATEGY_CLASS_NAME);
         writer.writeCharacters(xads.getValue(XML.ELEMENT_URL_SELECTOR_STRATEGY_CLASS_NAME,
                                              xads.getUrlSelectorStrategyClassName()));
         writer.writeEndElement();
      }

      if (xads.getNewConnectionSql() != null)
      {
         writer.writeStartElement(XML.ELEMENT_NEW_CONNECTION_SQL);
         writer.writeCharacters(xads.getValue(XML.ELEMENT_NEW_CONNECTION_SQL, xads.getNewConnectionSql()));
         writer.writeEndElement();
      }

      if (xads.getTransactionIsolation() != null)
      {
         writer.writeStartElement(XML.ELEMENT_TRANSACTION_ISOLATION);
         writer.writeCharacters(xads.getValue(XML.ELEMENT_TRANSACTION_ISOLATION,
                                              xads.getTransactionIsolation().toString()));
         writer.writeEndElement();
      }

      if (xads.getXaPool() != null)
         storeXaPool(xads.getXaPool(), writer);

      if (xads.getSecurity() != null)
         storeSecurity(xads.getSecurity(), writer);

      if (xads.getValidation() != null)
         storeValidation(xads.getValidation(), writer);

      if (xads.getTimeout() != null)
         storeTimeout(xads.getTimeout(), writer);

      if (xads.getStatement() != null)
         storeStatement(xads.getStatement(), writer);

      if (xads.getRecovery() != null)
         storeRecovery(xads.getRecovery(), writer);

      writer.writeEndElement();
   }
173428
public void writeMetadataDocument() throws ODataRenderException {

        try {
            xmlWriter.writeStartElement(EDMX_NS, EDMX);
            xmlWriter.writeNamespace(EDMX_PREFIX, EDMX_NS);
            xmlWriter.writeAttribute(VERSION, ODATA_VERSION);
            xmlWriter.writeStartElement(EDMX_NS, EDMX_DATA_SERVICES);

            boolean entityContinerWritten = false;
            // Loop over all the schemas present in the Entity Data Model
            for (Schema schema : entityDataModel.getSchemas()) {
                xmlWriter.writeStartElement(SCHEMA);
                xmlWriter.writeDefaultNamespace(EDM_NS);
                xmlWriter.writeAttribute(NAMESPACE, schema.getNamespace());
                for (Type type : schema.getTypes()) {
                    switch (type.getMetaType()) {
                        case ENTITY:
                            entityTypeWriter.write((EntityType) type);
                            break;
                        case COMPLEX:
                            complexTypeWriter.write((ComplexType) type);
                            break;
                        case ENUM:
                            enumTypeWriter.write((EnumType) type);
                            break;
                        default:
                            LOG.error("Unexpected type: {}", type.getFullyQualifiedName());
                            throw new ODataRenderException("Unexpected type: " + type.getFullyQualifiedName());
                    }
                }
                if (!entityContinerWritten) {
                    writeEntityContainer(entityDataModel.getEntityContainer());
                    entityContinerWritten = true;
                }

                // End of <Schema> element
                xmlWriter.writeEndElement();
            }

            xmlWriter.writeEndElement();
        } catch (XMLStreamException e) {
            LOG.error("Not possible to start stream XML");
            throw new ODataRenderException("Not possible to start stream XML: ", e);
        }
    }
479815
public void write(XMLStreamWriter writer, String xmlElementName, AttributeDefinition<?>... defs) throws XMLStreamException {
      boolean skip = true;
      for (AttributeDefinition def : defs) {
         skip = skip && !attribute(def).isModified();
      }
      if (!skip) {
         writer.writeStartElement(xmlElementName);
         for (AttributeDefinition def : defs) {
            Attribute attr = attribute(def);
            attr.write(writer, attr.getAttributeDefinition().xmlName());
         }
         writer.writeEndElement();
      }
   }
1263050
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    writer.newLine();
    writer.taggedValue("DMEUuid", dmeId);
    if(gatheringTargetDestUuid != null)
    {
      writer.newLine();
      writer.taggedValue("gatheringTargetDestUuid", gatheringTargetDestUuid);
    }
    if(durablePseudoDestID != null)
    {
      writer.newLine();
      writer.taggedValue("durablePseudoDestID", durablePseudoDestID);
    }
    if(durableSubName != null)
    {
      writer.newLine();
      writer.taggedValue("durableSubName", durableSubName);
    }
    if(durableSubHome != null)
    {
      writer.newLine();
      writer.taggedValue("durableSubHome", durableSubHome);
    }
  }
3127
static OutputStream toXlsxFile(final IDataSet dataSet) {
        ByteArrayOutputStream xlsx = new ByteArrayOutputStream();
        
        try { toWorkbook(dataSet, (Workbook) null).write(xlsx); }
        catch (IOException e) { throw new CalculationEngineException(e); }
        
        return xlsx;
    }
170534
public XMLWriter toXML(PrintWriter pw)
			throws IOException
			{

		XMLWriter     xw = new PrettyXMLWriter( pw);

		toXML(xw);
		return xw ;
			}