Package javax.xml.parsers

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


    Document result = null;
       try {
         DocumentBuilder dbuild = DocumentBuilderFactory.
                            newInstance().
                            newDocumentBuilder();
         result = dbuild.newDocument();
         Element msbibCollection = result.createElement("b:Sources");
         msbibCollection.setAttribute("SelectedStyle","");
         msbibCollection.setAttribute("xmlns", "http://schemas.openxmlformats.org/officeDocument/2006/bibliography");
         msbibCollection.setAttribute("xmlns:b", "http://schemas.openxmlformats.org/officeDocument/2006/bibliography");                  
        
View Full Code Here


    }
    public Document getDOMrepresentation() {
        Document result = null;
        try {
            DocumentBuilder dbuild = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            result = dbuild.newDocument();
            Element collection = result.createElement("office:document-content");
            //collection.setAttribute("xmlns", "http://openoffice.org/2000/office");
            collection.setAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
            collection.setAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
            collection.setAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0");
View Full Code Here

    Document result = null;
       try {
         DocumentBuilder dbuild = DocumentBuilderFactory.
                            newInstance().
                            newDocumentBuilder();
         result = dbuild.newDocument();
         Element modsCollection = result.createElement("modsCollection");
         modsCollection.setAttribute("xmlns", "http://www.loc.gov/mods/v3");
         modsCollection.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
         modsCollection.setAttribute("xsi:schemaLocation", "http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd");
        
View Full Code Here

   {
      Writer out = new StringWriter();

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.newDocument();

      Element serverElement = doc.createElement("server");

      // Store attributes as XML
      for (int j = 0; j < objectNames.length; j++)
View Full Code Here

    }
    public Document getDOMrepresentation() {
        Document result = null;
        try {
            DocumentBuilder dbuild = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            result = dbuild.newDocument();
            Element collection = result.createElement("office:document-content");
            //collection.setAttribute("xmlns", "http://openoffice.org/2000/office");
            collection.setAttribute("xmlns:office", "http://openoffice.org/2000/office");
            collection.setAttribute("xmlns:style", "http://openoffice.org/2000/style");
            collection.setAttribute("xmlns:text", "http://openoffice.org/2000/text");
View Full Code Here

      // will throw an exception if file not r/w or it is a directory
      File file = checkFileForWrite(id);
     
      // build the XML in memory using DOM
      DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      Document doc = builder.newDocument();

      // Add a comment
      Comment comment = doc.createComment(" automatically produced by XMLAttributePersistenceManager ");
      doc.appendChild(comment);
     
View Full Code Here

        DOMConverter.convert(doc, getDOMImplementation()));
  }
 
  private static org.w3c.dom.Document jaxbMarshalDOM(Marshaller marshaller, Object jaxbObj) throws JAXBException {
    DocumentBuilder docBuilder = (DocumentBuilder) LOCAL_DOC_BUILDER.get();
    org.w3c.dom.Document doc = docBuilder.newDocument();
    marshaller.marshal(jaxbObj, doc);
    return doc;
  }
 
  private static Object jaxbUnmarshalDOM(Unmarshaller unmarshaller, org.w3c.dom.Node node) throws JAXBException {
View Full Code Here

            catch (Exception e)
            {
                JPOXLogger.PERSISTENCE.info(LOCALISER.msg("034201", fileUrl.getFile()));

                // File doesn't exist, so create it
                doc = db.newDocument();
                rootElement = doc.createElement("jpox");
                doc.appendChild(rootElement);

                writeToFile();
            }
View Full Code Here

        try
        {
          // Dont do any deletion, just reconstruct the DOM with an empty root element
            db = factory.newDocumentBuilder();
            doc = db.newDocument();
            rootElement = doc.createElement("jpox");
            doc.appendChild(rootElement);
        }
        catch (ParserConfigurationException e)
        {
View Full Code Here

     
      // Create a new 'temp' XML element to use as a container
      // in which to marshal the UDDI response data into.
    
      DocumentBuilder docBuilder = getDocumentBuilder();
      Document document = docBuilder.newDocument();
      Element element = document.createElement("temp");
      // Lookup the appropriate response handler and marshal
      // the juddi object into the appropriate xml format (we
      // only support UDDI v2.0 at this time).  Attach the
      // results to the body of the SOAP response.
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.