Package org.apache.xerces.dom

Examples of org.apache.xerces.dom.DocumentImpl


    /** Start of DTD. */
    public void callStartDTD() throws Exception {
       
        // setup grammar document
        setGrammarDocument(null);
        fGrammarDocument = new DocumentImpl();
        fRootElement = fGrammarDocument.createElement("dtd");
        fCurrentElement = fRootElement;

    } // callStartDTD()
View Full Code Here


    @Test
    public void testSerialize()
    throws SerializationException, IllegalAccessException, InstantiationException {
        ValidationReportBuilder validationReportBuilder = new DefaultValidationReportBuilder();

        Document document = new DocumentImpl();
        Element element = document.createElement("html");
        validationReportBuilder.reportIssue(ValidationReport.IssueLevel.info, "Test message", element);

        validationReportBuilder.traceRuleActivation( new MetaNameMisuseRule() );

        validationReportBuilder.reportRuleError(
View Full Code Here

  /**
   * This is called to create a document.
   */
  protected Document createDocument()
  {
    return new DocumentImpl();
  }
View Full Code Here

    // Create a XPath parser.
    XPathProcessorImpl parser = new XPathProcessorImpl(xpathSupport);
   
    // Create a dummy document for namespace resolution.
    // You may want to use a real document node here from the XSL Stylesheet for namespace resolution.
    Document doc = new DocumentImpl();
    Element docElem = doc.createElement("dummy");
    doc.appendChild(docElem);
   
    try
    {
      // Parse the XPath.
      parser.initXPath(xpath, args[0], null);
View Full Code Here

    /** Start of DTD. */
    public void callStartDTD() throws Exception {
       
        // setup grammar document
        setGrammarDocument(null);
        fGrammarDocument = new DocumentImpl();
        fRootElement = fGrammarDocument.createElement("dtd");
        fCurrentElement = fRootElement;

    } // callStartDTD()
View Full Code Here

            }

            // full expansion
            else {
                if (isDocumentImpl) {
                    fDocumentImpl = new DocumentImpl(fGrammarAccess);
                    fDocument = fDocumentImpl;
                    // set DOM error checking off
                    fDocumentImpl.setErrorChecking(false);
                }
                else {
View Full Code Here

        // full expansion
        else {

            if (documentClassName.equals(DEFAULT_DOCUMENT_CLASS_NAME)) {
                fDocument = fDocumentImpl = new DocumentImpl(fGrammarAccess);
            }
            else {
                try {
                    Class documentClass = Class.forName(documentClassName);
                    fDocument = (Document)documentClass.newInstance();
View Full Code Here

   */
  public void save() throws IOException {
    try {
      final FileOutputStream fos = new FileOutputStream(new File(configfile
          .getFile()));
      final Document doc = new DocumentImpl();
      final Element collections = doc
          .createElement(Subcollection.TAG_COLLECTIONS);
      final Iterator iterator = collectionMap.values().iterator();

      while (iterator.hasNext()) {
        final Subcollection subCol = (Subcollection) iterator.next();
        final Element collection = doc
            .createElement(Subcollection.TAG_COLLECTION);
        collections.appendChild(collection);
        final Element name = doc.createElement(Subcollection.TAG_NAME);
        name.setNodeValue(subCol.getName());
        collection.appendChild(name);
        final Element whiteList = doc
            .createElement(Subcollection.TAG_WHITELIST);
        whiteList.setNodeValue(subCol.getWhiteListString());
        collection.appendChild(whiteList);
        final Element blackList = doc
            .createElement(Subcollection.TAG_BLACKLIST);
        blackList.setNodeValue(subCol.getBlackListString());
        collection.appendChild(blackList);
      }

View Full Code Here

   *
   * @return a new instance of a DOM Document object.
   */
  public Document newDocument()
  {
    return new DocumentImpl();
  }
View Full Code Here

                : "";
        }
    }

    public static Document newDocument(Node firstElement, boolean deepcopy) {
        Document newDoc = new DocumentImpl();
        newDoc.appendChild(newDoc.importNode(firstElement, deepcopy));
        return newDoc;
    }
View Full Code Here

TOP

Related Classes of org.apache.xerces.dom.DocumentImpl

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.