Home » Xerces-J-src.2.9.1 » xni » parser » [javadoc | source]
xni.parser
public class: CSVConfiguration [javadoc | source]
java.lang.Object
   xni.parser.AbstractConfiguration
      xni.parser.CSVConfiguration

All Implemented Interfaces:
    XMLParserConfiguration

This example is a very simple parser configuration that can parse files with comma-separated values (CSV) to generate XML events. For example, the following CSV document:
Andy Clark,16 Jan 1973,Cincinnati
produces the following XML "document" as represented by the XNI streaming document information:
<?xml version='1.0' encoding='UTF-8' standalone='true'?>
<!DOCTYPE csv [
<!ELEMENT csv (row)*>
<!ELEMENT row (col)*>
<!ELEMENT col (#PCDATA)>
]>
<csv>
<row>
<col>Andy Clark</col>
<col>16 Jan 1973</col>
<col>Cincinnati</col>
</row>
</csv>
Field Summary
protected static final  QName CSV    A QName for the <csv> element name. 
protected static final  QName ROW    A QName for the <row> element name. 
protected static final  QName COL    A QName for the <col> element name. 
protected static final  XMLAttributes EMPTY_ATTRS    An empty list of attributes. 
Fields inherited from xni.parser.AbstractConfiguration:
fRecognizedFeatures,  fRecognizedProperties,  fFeatures,  fProperties,  fEntityResolver,  fErrorHandler,  fDocumentHandler,  fDTDHandler,  fDTDContentModelHandler,  fLocale,  fComponents
Method from xni.parser.CSVConfiguration Summary:
getFeature,   getProperty,   parse,   setFeature,   setProperty
Methods from xni.parser.AbstractConfiguration:
addComponent,   addRecognizedFeatures,   addRecognizedProperties,   getDTDContentModelHandler,   getDTDHandler,   getDocumentHandler,   getEntityResolver,   getErrorHandler,   getFeature,   getLocale,   getProperty,   openInputSourceStream,   parse,   resetComponents,   setDTDContentModelHandler,   setDTDHandler,   setDocumentHandler,   setEntityResolver,   setErrorHandler,   setFeature,   setLocale,   setProperty
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from xni.parser.CSVConfiguration Detail:
 public boolean getFeature(String featureId) 
 public Object getProperty(String propertyId) 
 public  void parse(XMLInputSource source) throws IOException, XNIException 
    Parse an XML document.

    The parser can use this method to instruct this configuration to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

    Parsers may not invoke this method while a parse is in progress. Once a parse is complete, the parser may then parse another XML document.

    This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.

 public  void setFeature(String featureId,
    boolean state) 
 public  void setProperty(String propertyId,
    Object value)