Package com.ctc.wstx.stax

Examples of com.ctc.wstx.stax.WstxInputFactory


     */

    private XMLStreamReader getReader(String contents, boolean nsAware)
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        f.getConfig().doValidateWithDTD(false);
        f.getConfig().doSupportNamespaces(nsAware);
        return constructStreamReader(f, contents);
    }
View Full Code Here


    }

    private XMLStreamReader getValidatingReader(String contents, boolean nsAware)
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        f.getConfig().doSupportNamespaces(nsAware);
        f.getConfig().doSupportDTDs(true);
        f.getConfig().doValidateWithDTD(true);
        return constructStreamReader(f, contents);
    }
View Full Code Here

    private XMLStreamReader getReader(String contents, boolean prologWS,
                                      boolean lazyParsing)
        throws XMLStreamException
    {
        WstxInputFactory f = (WstxInputFactory) getInputFactory();
        ReaderConfig cfg = f.getConfig();
        cfg.doReportPrologWhitespace(prologWS);
        cfg.doParseLazily(lazyParsing);
        return constructStreamReader(f, contents);
    }
View Full Code Here

     */

    private XMLStreamReader2 getReader(String contents, boolean coalesce)
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        f.getConfig().doSupportNamespaces(true);
        f.getConfig().doCoalesceText(coalesce);
        f.getConfig().setInputBufferLength(16);
        f.getConfig().setShortestReportedTextSegment(4);
        return (XMLStreamReader2) constructStreamReader(f, contents);
    }
View Full Code Here

        }
        sb.append("</a>");

        // And then we'll parse to ensure line numbers and offsets are ok
       
        WstxInputFactory f = getWstxInputFactory();
        // Need to shrink it to get faster convergence
        f.getConfig().setInputBufferLength(23);
        XMLStreamReader2 sr = (XMLStreamReader2) f.createXMLStreamReader(new StringReader(sb.toString()));

        assertTokenType(START_ELEMENT, sr.next());

        int linenr = 1;
        int col = 4;
View Full Code Here

        StringBuffer inputBuf = new StringBuffer();
        StringBuffer expOut = new StringBuffer();
        generateData(new Random(123), inputBuf, expOut, true);
        String inputStr = inputBuf.toString();

        WstxInputFactory f = getWstxInputFactory();
        // Should shrink it to get faster convergence
        f.getConfig().setInputBufferLength(17);
        f.getConfig().doCoalesceText(coal);
        XMLStreamReader2 sr = (XMLStreamReader2) f.createXMLStreamReader(new StringReader(inputStr));

        int lastLine = 0;
        int lastOffset = 0;

        while (sr.next() != XMLStreamConstants.END_DOCUMENT) {
View Full Code Here

   * @return
   * @throws XMLStreamException
   */
  public SBMLDocument readSBMLFromStream(InputStream stream, TreeNodeChangeListener listener)
      throws XMLStreamException {
    WstxInputFactory inputFactory = new WstxInputFactory();
    XMLEventReader xmlEventReader = inputFactory.createXMLEventReader(stream);
    return (SBMLDocument) readXMLFromXMLEventReader(xmlEventReader, listener);   
  }
View Full Code Here

   * @return
   * @throws XMLStreamException
   */
  private Object readXMLFromStream(InputStream stream, TreeNodeChangeListener listener)
      throws XMLStreamException {
    WstxInputFactory inputFactory = new WstxInputFactory();
    XMLEventReader xmlEventReader = inputFactory.createXMLEventReader(stream);
    return readXMLFromXMLEventReader(xmlEventReader, listener);
  }
View Full Code Here

     * and introspection via SAX classes (as opposed to JAXP-based
     * introspection).
     */
    public WstxSAXParser()
    {
        this(new WstxInputFactory(), FEAT_DEFAULT_NS_PREFIXES);
    }
View Full Code Here

     */
    boolean mFeatNsPrefixes = false;

    public WstxSAXParserFactory()
    {
        mStaxFactory = new WstxInputFactory();

        /* defaults should be fine... except that for some weird
         * reason, by default namespace support is defined to be off
         */
        setNamespaceAware(true);
View Full Code Here

TOP

Related Classes of com.ctc.wstx.stax.WstxInputFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.