Package org.jdom

Examples of org.jdom.DocType


        this.currentElement.addContent(new EntityRef(name));
    }

    public void writeDocType(String name, String sys, String pub, String subset)
            throws IOException {
        DocType docType;
        if(null != pub) {
            docType = new DocType(name, pub, sys);
        } else if(null != sys) {
            docType = new DocType(name, sys);
        } else {
            docType = new DocType(name);
        }
        if(null != subset) {
            docType.setInternalSubset(subset);
        }
        this.document.setDocType(docType);
    }
View Full Code Here


            }
            else {
                result.add(new Attribute(localName, pi.getValue(localName)));
            }
        } else if (node instanceof DocType) {
            DocType doctype = (DocType)node;
            if ("publicId".equals(localName)) {
                result.add(new Attribute("publicId", doctype.getPublicID()));
            }
            else if ("systemId".equals(localName)) {
                result.add(new Attribute("systemId", doctype.getSystemID()));
            }
            else if ("elementName".equals(localName)) {
                result.add(new Attribute("elementName", doctype.getElementName()));
            }
        }
    }
View Full Code Here

    }

    // we have all together for the channel definition
    rootElem.addContent(channelElem);
    // ---
    DocType docType = new DocType("rss", PUBLIC_ID, SYSTEM_ID);
    Document doc = new Document(rootElem, docType);
    outputter.output(doc, writer);
  }
View Full Code Here

                else if ("data".equals(localName))
                    attr = new Attribute("data", pi.getData());
                else
                    attr = new Attribute(localName, pi.getValue(localName));
            } else if (node instanceof DocType) {
                DocType doctype = (DocType)node;
                if ("publicId".equals(localName))
                    attr = new Attribute("publicId", doctype.getPublicID());
                else if ("systemId".equals(localName))
                    attr = new Attribute("systemId", doctype.getSystemID());
                else if ("elementName".equals(localName))
                    attr = new Attribute("elementName", doctype.getElementName());
            }
            // With 2.1 semantics it  makes more sense to just return a null and let the core
            // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
            else {
                return null;
View Full Code Here

    private static final class DocTypeOp implements NodeOperator {
        public List operate(Object node)
        {
            if (node instanceof Document) {
                DocType doctype = ((Document)node).getDocType();
                return doctype == null ? Collections.EMPTY_LIST : Collections12.singletonList(doctype);
            } else
                // With 2.1 semantics it  makes more sense to just return a null and let the core
                // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
                return null;
View Full Code Here

      }
      if (!newValidators.isEmpty()) {
        rootElement.addContent(newValidators);
      }
      if (is11()) {
        document.setDocType(new DocType("faces-config",
            "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN",
           "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"));
      }
      writer =
          getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(targetFacesConfigFile), null);
View Full Code Here

            // try to extract either SYSTEM or PUBLIC ID and guess the schema
            // specific builder based on the schema file name
            InputStream docStream = url.openStream();
            Document doc = builder.build(docStream);
            docStream.close();
            DocType type = doc.getDocType();

            version = validateVersionString(type.getPublicID());
            if (version == NO_VERSION)
            {
               version = validateVersionString(type.getSystemID());              
            } // end of if ()
           
            /*
            versionString = type.getSystemID();

View Full Code Here

        XMLOutputter outputter = new XMLOutputter();
        CharArrayWriter writer = new CharArrayWriter();
        Document document = node.getDocument();
        try {
            if (document != null) {
                DocType docType = document.getDocType();
                if (docType != null) {
                    outputter.output(docType, writer);
                }
            }
            outputter.output(node, writer);
View Full Code Here

    // Do not validate on export
    Document doc = ParserLib .parser(new StringReader(xmlString), !export);

    if(export){
      doc.setDocType(new DocType("NetConditionEventSystem"));
      writeToFile(outputXMLFile, doc);
    }
    else{
      writeToFile(outputXMLFile, doc);
    }
View Full Code Here

          rootElement.addContent(lastIndex, newConverters);
        }
        if (!newValidators.isEmpty()) {
          rootElement.addContent(newValidators);
        }
        document.setDocType(new DocType("faces-config",
            "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN",
            "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"));

        writer =
            getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(targetFacesConfigFile), null);
View Full Code Here

TOP

Related Classes of org.jdom.DocType

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.