org.dbunit.dataset.xml
Class XmlDataSet

java.lang.Object
  extended byorg.dbunit.dataset.AbstractDataSet
      extended byorg.dbunit.dataset.CachedDataSet
          extended byorg.dbunit.dataset.xml.XmlDataSet
All Implemented Interfaces:
IDataSet, IDataSetConsumer

public class XmlDataSet
extends CachedDataSet

Reads and writes original XML dataset document. This format is very verbiose 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>

Since:
Feb 17, 2002
Version:
$Revision: 1.20 $
Author:
Manuel Laflamme

Constructor Summary
XmlDataSet(java.io.InputStream in)
          Creates an XmlDataSet with the specified xml input stream.
XmlDataSet(java.io.Reader reader)
          Creates an XmlDataSet with the specified xml reader.
 
Method Summary
static void write(IDataSet dataSet, java.io.OutputStream out)
          Write the specified dataset to the specified output stream as xml.
static void write(IDataSet dataSet, java.io.Writer writer)
          Write the specified dataset to the specified writer as xml.
static void write(IDataSet dataSet, java.io.Writer writer, java.lang.String encoding)
          Write the specified dataset to the specified writer as xml.
 
Methods inherited from class org.dbunit.dataset.CachedDataSet
createIterator, endDataSet, endTable, row, startDataSet, startTable
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
cloneTables, getTable, getTableMetaData, getTableNames, getTables, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlDataSet

public XmlDataSet(java.io.Reader reader)
           throws DataSetException
Creates an XmlDataSet with the specified xml reader.


XmlDataSet

public XmlDataSet(java.io.InputStream in)
           throws DataSetException
Creates an XmlDataSet with the specified xml input stream.

Method Detail

write

public static void write(IDataSet dataSet,
                         java.io.OutputStream out)
                  throws java.io.IOException,
                         DataSetException
Write the specified dataset to the specified output stream as xml.

Throws:
java.io.IOException
DataSetException

write

public static void write(IDataSet dataSet,
                         java.io.Writer writer)
                  throws java.io.IOException,
                         DataSetException
Write the specified dataset to the specified writer as xml.

Throws:
java.io.IOException
DataSetException

write

public static void write(IDataSet dataSet,
                         java.io.Writer writer,
                         java.lang.String encoding)
                  throws java.io.IOException,
                         DataSetException
Write the specified dataset to the specified writer as xml.

Throws:
java.io.IOException
DataSetException


Copyright © 2002-2004 DbUnit.org. All Rights Reserved.