Class XmlDataSet

All Implemented Interfaces:
IDataSet, IDataSetConsumer

public class XmlDataSet extends CachedDataSet
Reads and writes original XML dataset document. This format is very verbose and must conform to the following DTD:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT dataset (table+)>
<!ELEMENT table (column*, row*)>
<!ATTLIST table name CDATA #REQUIRED>
<!ELEMENT column (#PCDATA)>
<!ELEMENT row (value | null | none)*>
<!ELEMENT value (#PCDATA)>
<!ELEMENT null EMPTY>
<!ELEMENT none EMPTY>
Since:
1.0 (Feb 17, 2002)
Version:
$Revision$ $Date$
Author:
Manuel Laflamme, Last changed by: $Author$
  • Constructor Details

    • XmlDataSet

      public XmlDataSet(Reader reader) throws DataSetException
      Creates an XmlDataSet with the specified xml reader.
      Parameters:
      reader - the reader to load the xml document from.
      Throws:
      DataSetException - if the document cannot be parsed.
    • XmlDataSet

      public XmlDataSet(InputStream in) throws DataSetException
      Creates an XmlDataSet with the specified xml input stream.
      Parameters:
      in - the stream to load the xml document from.
      Throws:
      DataSetException - if the document cannot be parsed.
  • Method Details

    • write

      public static void write(IDataSet dataSet, OutputStream out) throws IOException, DataSetException
      Write the specified dataset to the specified output stream as xml.
      Parameters:
      dataSet - the dataset to write.
      out - the stream to write the xml document to.
      Throws:
      IOException - if writing to the stream fails.
      DataSetException - if the dataset cannot be read.
    • write

      public static void write(IDataSet dataSet, OutputStream out, Charset charset) throws IOException, DataSetException
      Write the specified dataset to the specified output stream as xml (using specified encoding).
      Parameters:
      dataSet - the dataset to write.
      out - the stream to write the xml document to.
      charset - the character encoding to write the document in.
      Throws:
      IOException - if writing to the stream fails.
      DataSetException - if the dataset cannot be read.
    • write

      public static void write(IDataSet dataSet, Writer writer) throws IOException, DataSetException
      Write the specified dataset to the specified writer as xml.
      Parameters:
      dataSet - the dataset to write.
      writer - the writer to write the xml document to.
      Throws:
      IOException - if writing to the writer fails.
      DataSetException - if the dataset cannot be read.
    • write

      public static void write(IDataSet dataSet, Writer writer, Charset charset) throws IOException, DataSetException
      Write the specified dataset to the specified writer as xml.
      Parameters:
      dataSet - the dataset to write.
      writer - the writer to write the xml document to.
      charset - the character encoding to write the document in.
      Throws:
      IOException - if writing to the writer fails.
      DataSetException - if the dataset cannot be read.