Search in sources :

Example 1 with SAXReaderSettings

use of com.helger.xml.serialize.read.SAXReaderSettings in project as2-server by phax.

the class SocketCommandParser method parse.

public void parse(@Nullable final String sInLine) {
    m_sUserID = "";
    m_sPassword = "";
    m_sCommandText = "";
    m_aContents.reset();
    if (sInLine != null) {
        SAXReader.readXMLSAX(sInLine, new SAXReaderSettings().setEntityResolver(this).setDTDHandler(this).setContentHandler(this).setErrorHandler(this));
    }
}
Also used : SAXReaderSettings(com.helger.xml.serialize.read.SAXReaderSettings)

Example 2 with SAXReaderSettings

use of com.helger.xml.serialize.read.SAXReaderSettings in project ph-schematron by phax.

the class PSReader method readSchema.

/**
 * Read the schema from the resource supplied in the constructor. First all
 * includes are resolved and than {@link #readSchemaFromXML(IMicroElement)} is
 * called.
 *
 * @return The read {@link PSSchema}.
 * @throws SchematronReadException
 *         If reading fails
 */
@Nonnull
public PSSchema readSchema() throws SchematronReadException {
    // Resolve all includes as the first action
    final SAXReaderSettings aSettings = new SAXReaderSettings().setEntityResolver(m_aEntityResolver);
    final IMicroDocument aDoc = SchematronHelper.getWithResolvedSchematronIncludes(m_aResource, aSettings, m_aErrorHandler);
    if (aDoc == null || aDoc.getDocumentElement() == null)
        throw new SchematronReadException(m_aResource, "Failed to resolve includes in Schematron resource " + m_aResource);
    if (SchematronDebug.isShowResolvedSourceSchematron())
        s_aLogger.info("Resolved source Schematron:\n" + MicroWriter.getNodeAsString(aDoc));
    return readSchemaFromXML(aDoc.getDocumentElement());
}
Also used : SAXReaderSettings(com.helger.xml.serialize.read.SAXReaderSettings) IMicroDocument(com.helger.xml.microdom.IMicroDocument) Nonnull(javax.annotation.Nonnull)

Aggregations

SAXReaderSettings (com.helger.xml.serialize.read.SAXReaderSettings)2 IMicroDocument (com.helger.xml.microdom.IMicroDocument)1 Nonnull (javax.annotation.Nonnull)1