Package javax.xml.parsers

Examples of javax.xml.parsers.DocumentBuilder.newDocument()


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

    public void testGeneratePathNameFromRootForRoot()
        throws Exception
    {
View Full Code Here


    {
        try
        {
            final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            final DocumentBuilder builder = factory.newDocumentBuilder();
            final Document document = builder.newDocument();

            return createElement( document, configuration );
        }
        catch( final Throwable t )
        {
View Full Code Here

    /*
     * 1. Creating the root element
     */
    DocumentBuilder builder = getDocumentBuilder(system);
    Document doc = builder.newDocument();
    Element root = doc.createElement(mEncodingSystem);
    doc.appendChild(root);

    /*
     * 2. Getting the interface description
View Full Code Here

            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(false);
            DocumentBuilder builder = dbf.newDocumentBuilder();
            Document srcDoc = builder.parse(is);
            dbf.setNamespaceAware(true);
            Document destDoc = builder.newDocument();
            transform(srcDoc, destDoc);

            NodeList chainNodes = destDoc.getFirstChild().getChildNodes();
            for (int i = 0; i < chainNodes.getLength(); i++) {
                Node node = chainNodes.item(i);
View Full Code Here

    factory.setValidating(validating);
    factory.setNamespaceAware(namespaceAware);

    DocumentBuilder builder = factory.newDocumentBuilder();

    return builder.newDocument();
  }
}

/*
* Redistribution and use of this software and associated documentation
View Full Code Here

    {
      throw new XException(Constants.LOCATION_INTERN,
          Constants.LAYER_PROTOCOL, Constants.PACKAGE_PROTOCOL_CSV,
          "13");
    }
    Document resultDocument = builder.newDocument();

    // create root node <i>systemName</i>
    Element root = resultDocument.createElement(systemName);
    resultDocument.appendChild(root);
View Full Code Here

  private Document parseRecords(Object interfaceContent,
      int interfaceContentClass, XBUSSystem system) throws XException
  {
    Document retDocument;
    DocumentBuilder builder = getDocumentBuilder(system);
    retDocument = builder.newDocument();
    // for the parsed content
    RecordTypeParser rtParser = RecordTypeParser.getInstance(getSource()
        .getName(), interfaceContentClass);
    // Get a parser object
View Full Code Here

                                                               new QName("http://www.w3.org/2001/XMLSchema",
                                                                         "schema"));

            DocumentBuilder docBuilder;
            docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            Document doc = docBuilder.newDocument();
            Element element = doc.createElement("xsd:schema");
            Map<String, String> schemafileMap = wmodel.getSchemaNSFileMap();

            Set<Map.Entry<String, String>> entryset = schemafileMap.entrySet();
            Iterator<Map.Entry<String, String>> ite = entryset.iterator();
View Full Code Here

  public void testXMPSchemaBibtexElement()
    throws ParserConfigurationException {
    DocumentBuilderFactory builderFactory = DocumentBuilderFactory
      .newInstance();
    DocumentBuilder builder = builderFactory.newDocumentBuilder();
    Element e = builder.newDocument().createElement("rdf:Description");

    XMPSchemaBibtex bibtex = new XMPSchemaBibtex(e, "bibtex");

    assertEquals(e, bibtex.getElement());
    assertEquals("rdf:Description", bibtex.getElement().getTagName());
View Full Code Here

        }
        catch (ParserConfigurationException pce) {}
      }
     
      DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
      Document outNode = docBuilder.newDocument();

      return outNode;
    }
    catch (ParserConfigurationException pce)
    {
View Full Code Here

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.