Examples of DocumentBuilder


Examples of javax.xml.parsers.DocumentBuilder

        dbf.setValidating(false);
        dbf.setIgnoringComments(false);
        dbf.setIgnoringElementContentWhitespace(true);
        dbf.setNamespaceAware(true);
       
        DocumentBuilder db = dbf.newDocumentBuilder();
        db.setEntityResolver(new NullResolver());
        doc = STAXUtils.read(db, reader, false);
       
        WSS4JInHandler inHandler = new WSS4JInHandler();

        InMessage inmsg = new InMessage();

Examples of javax.xml.parsers.DocumentBuilder

         DocumentBuilderFactory dbf = glob.getDocumentBuilderFactory();
         //dbf.setNamespaceAware(true);
         //dbf.setCoalescing(true);
         //dbf.setValidating(false);
         //dbf.setIgnoringComments(true);
         DocumentBuilder db = dbf.newDocumentBuilder ();
         bigDoc = db.parse(input);
      } catch (Exception e) {
         e.printStackTrace();
      }

     

Examples of javax.xml.parsers.DocumentBuilder

      DocumentBuilderFactory dbf = glob.getDocumentBuilderFactory();
      dbf.setNamespaceAware(true);
      //dbf.setCoalescing(true);
      //dbf.setValidating(false);
      //dbf.setIgnoringComments(true);
      DocumentBuilder db = dbf.newDocumentBuilder();
      if (log.isLoggable(Level.FINE)) log.fine("Tracing " + new String(content));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(content);
      Document doc = db.parse(inputStream);
      return doc;
   }

Examples of javax.xml.parsers.DocumentBuilder

    }

    private Document createDocument() throws ParserConfigurationException
    {
        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        final DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.newDocument();
    }

Examples of javax.xml.parsers.DocumentBuilder

    public static Element toElement( final Configuration configuration )
    {
        try
        {
            final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            final DocumentBuilder builder = factory.newDocumentBuilder();
            final Document document = builder.newDocument();

            return createElement( document, configuration );
        }
        catch( final Throwable t )
        {

Examples of mf.javax.xml.parsers.DocumentBuilder

   */
  public void readCatalog(Catalog catalog, InputStream is)
    throws IOException, CatalogException {

    DocumentBuilderFactory factory = null;
    DocumentBuilder builder = null;

    factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(false);
    factory.setValidating(false);
    try {
      builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException pce) {
      throw new CatalogException(CatalogException.UNPARSEABLE);
    }

    Document doc = null;

    try {
      //MF
      doc = (Document) builder.parse(is);
    } catch (SAXException se) {
      throw new CatalogException(CatalogException.UNKNOWN_FORMAT);
    }

    Element root = doc.getDocumentElement();

Examples of net.java.textilej.parser.DocumentBuilder

    state.setMarkupContent(markupContent);
    LocationTrackingReader reader = new LocationTrackingReader(new StringReader(markupContent));
    String line;
    Block currentBlock = null;
   
    DocumentBuilder builder = parser.getBuilder();
   
    builder.setLocator(state);
    try {
      if (asDocument) {
        builder.beginDocument();
      }
     
      try {
        while ((line = reader.readLine()) != null) {
         
          state.setLineNumber(reader.getLineNumber()+1);
          state.setLineOffset(reader.getLineOffset());
          state.setLineCharacterOffset(0);
          state.setLineSegmentEndOffset(0);
          state.setLineLength(line.length());
         
          int lineOffset = 0;
          for (;;) {
            if (currentBlock == null) {
              currentBlock = startBlock(line,lineOffset);
              if (currentBlock == null) {
                break;
              }
              currentBlock.setState(state);
              currentBlock.setParser(parser);
            }
            lineOffset = currentBlock.processLineContent(line,lineOffset);
            if (currentBlock.isClosed()) {
              currentBlock = null;
            }
            if (lineOffset < line.length() && lineOffset >= 0) {
              if (currentBlock != null) {
                throw new IllegalStateException("if a block does not fully process a line then it must be closed");
              }
            } else {
              break;
            }
          }
        }
        state.setLineNumber(reader.getLineNumber()+1);
        state.setLineOffset(reader.getLineOffset());
        state.setLineCharacterOffset(0);
        state.setLineLength(0);
       
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
     
      if (currentBlock != null && !currentBlock.isClosed()) {
        currentBlock.setClosed(true);
      }
     
      if (asDocument) {
        builder.endDocument();
      }
    } finally {
      builder.setLocator(null);
    }
  }

Examples of net.rim.device.api.xml.parsers.DocumentBuilder

            try {
                // Obtain the Browser field config
                BrowserFieldConfig bfConfig = getBrowserFieldConfig();

                // Create doc builder
                DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();

                // Parse
                Object o = bfConfig.getProperty( BrowserFieldConfig.CONTROLLER );
                if( o instanceof BrowserFieldController ) {
                    BrowserFieldController bfController = (BrowserFieldController) o;

                    // Create request for config.xml file
                    BrowserFieldRequest request = new BrowserFieldRequest( WidgetUtil.getLocalPath( _configXML ) );
                    InputConnection inputConn = bfController.handleResourceRequest( request );

                    // Create a Document object out of the config.xml
                    _configXMLDoc = docBuilder.parse( inputConn.openDataInputStream() );
                }

            } catch( Exception e ) {
            }
        }

Examples of net.sf.clairv.index.builder.DocumentBuilder

    int dot = name.lastIndexOf('.');
    if (dot > 0) {
      String ext = name.substring(dot + 1);
      String clazz = extensionMappings.getProperty(ext);
      if (clazz != null) {
        DocumentBuilder db = (DocumentBuilder)builders.get(clazz);
        if (db == null) {
          try {
            db = (DocumentBuilder) Class.forName(clazz).newInstance();
            return db;
          } catch (Exception e) {

Examples of net.sf.saxon.s9api.DocumentBuilder

    private String errorMessage(QName code) {
        InputStream instream = getClass().getResourceAsStream("/etc/error-list.xml"); //TODO - Get proper path to this
        if (instream != null) {
            try {
                SAXSource source = new SAXSource(new InputSource(instream));
                DocumentBuilder builder = runtime.getProcessor().newDocumentBuilder();
                XdmNode doc = builder.build(source);
                XdmSequenceIterator iter = doc.axisIterator(Axis.DESCENDANT, new QName("error"));
                while (iter.hasNext()) {
                    XdmNode error = (XdmNode) iter.next();
                    if (code.getLocalName().equals(error.getAttributeValue(_code))) {
                        return error.getStringValue();
TOP
Copyright © 2018 www.massapi.com. 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.