// Path: core/src/main/java/edu/upenn/library/xmlaminar/SAXFeatures.java
// public class SAXFeatures {
//     public static final String NAMESPACES = "http://xml.org/sax/features/namespaces";
//     public static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes";
//     public static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning";
//     public static final String VALIDATION = "http://xml.org/sax/features/validation";
//     public static final String EXTERNAL_GENERAL_ENTITIES = "http://xml.org/sax/features/external-general-entities";
//     public static final String EXTERNAL_PARAMETER_ENTITIES = "http://xml.org/sax/features/external-parameter-entities";
// }
// 
// Path: core/src/main/java/edu/upenn/library/xmlaminar/XMLInputValidator.java
// public static void writeSanitizedXMLCharacters(char[] cbuf, int off, int len, ContentHandler ch) throws SAXException {
//     sanitizeXMLCharacters(cbuf, off, len);
//     ch.characters(cbuf, off, len);
// }


import edu.upenn.library.xmlaminar.SAXFeatures;
import static edu.upenn.library.xmlaminar.XMLInputValidator.writeSanitizedXMLCharacters;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.HashMap;
import java.util.Map;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.stream.StreamResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
    }

    public RSXMLReader(int batchSize, int lookaheadFactor) {
        super(InputImplementation.CHAR_ARRAY, unmodifiableFeatures, batchSize, lookaheadFactor);
    }

    @Override
    protected void outputFieldAsSAXEvents(long selfId, String fieldLabel, char[] content, int endIndex) throws SAXException, IOException {
        if (content != null) {
            ch.startElement("", fieldLabel, fieldLabel, attRunner);
            writeSanitizedXMLCharacters(content, 0, endIndex, ch);
            ch.endElement("", fieldLabel, fieldLabel);
        }
    }

    @Override
    protected void outputFieldAsSAXEvents(long selfId, String fieldLabel, Reader content) throws SAXException, IOException {
        if (content != null) {
            ch.startElement("", fieldLabel, fieldLabel, attRunner);
            outputCharacters(content);
            ch.endElement("", fieldLabel, fieldLabel);
        }
    }

    @Override
    protected void outputFieldAsSAXEvents(long selfId, String fieldLabel, byte[] content) throws SAXException, IOException {
        throw new UnsupportedOperationException();
    }

    @Override
// Path: core/src/main/java/edu/upenn/library/xmlaminar/SAXFeatures.java
// public class SAXFeatures {
//     public static final String NAMESPACES = "http://xml.org/sax/features/namespaces";
//     public static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes";
//     public static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning";
//     public static final String VALIDATION = "http://xml.org/sax/features/validation";
//     public static final String EXTERNAL_GENERAL_ENTITIES = "http://xml.org/sax/features/external-general-entities";
//     public static final String EXTERNAL_PARAMETER_ENTITIES = "http://xml.org/sax/features/external-parameter-entities";
// }
// 
// Path: core/src/main/java/edu/upenn/library/xmlaminar/XMLInputValidator.java
// public static void writeSanitizedXMLCharacters(char[] cbuf, int off, int len, ContentHandler ch) throws SAXException {
//     sanitizeXMLCharacters(cbuf, off, len);
//     ch.characters(cbuf, off, len);
// }


// Path: core/src/main/java/edu/upenn/library/xmlaminar/dbxml/RSXMLReader.java
import edu.upenn.library.xmlaminar.SAXFeatures;
import static edu.upenn.library.xmlaminar.XMLInputValidator.writeSanitizedXMLCharacters;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.HashMap;
import java.util.Map;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.stream.StreamResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;

    }

    public RSXMLReader(int batchSize, int lookaheadFactor) {
        super(InputImplementation.CHAR_ARRAY, unmodifiableFeatures, batchSize, lookaheadFactor);
    }

    @Override
    protected void outputFieldAsSAXEvents(long selfId, String fieldLabel, char[] content, int endIndex) throws SAXException, IOException {
        if (content != null) {
            ch.startElement("", fieldLabel, fieldLabel, attRunner);
            writeSanitizedXMLCharacters(content, 0, endIndex, ch);
            ch.endElement("", fieldLabel, fieldLabel);
        }
    }

    @Override
    protected void outputFieldAsSAXEvents(long selfId, String fieldLabel, Reader content) throws SAXException, IOException {
        if (content != null) {
            ch.startElement("", fieldLabel, fieldLabel, attRunner);
            outputCharacters(content);
            ch.endElement("", fieldLabel, fieldLabel);
        }
    }

    @Override
    protected void outputFieldAsSAXEvents(long selfId, String fieldLabel, byte[] content) throws SAXException, IOException {
        throw new UnsupportedOperationException();
    }

    @Override
    protected void outputFieldAsSAXEvents(long selfId, String fieldLabel, InputStream content) throws SAXException, IOException {