Package org.apache.xerces.dom

Examples of org.apache.xerces.dom.DocumentImpl


    */
    public Element getDOM()
    {
        if (moElem == null)
        {
            moElem = toDOM(new DocumentImpl());
            moElem.getOwnerDocument().appendChild(moElem);
        }

        return moElem;

View Full Code Here


        oAuthority.setProviderId(moAuth.getAuthorityId());

        KeyInfo oKeyInfo = null;
        if (moCertChain != null)
        {
            Document oDoc = new DocumentImpl();
            oKeyInfo = new KeyInfo(oDoc);
            X509Data oData = new X509Data(oDoc);
            oData.addCertificate(moCertChain[0]);
            oKeyInfo.add(oData);
            oAuthority.setKeyInfo(oKeyInfo);
View Full Code Here

        System.err.println("URL : "+dbUrl);
        System.err.println("user : "+dbUser);
        System.err.println("password : "+dbPassword);

        DocumentTypeImpl docType= new DocumentTypeImpl(null,"app-data", null, "http://jakarta.apache.org/turbine/dtd/database.dtd");
        doc = new DocumentImpl(docType);
        doc.appendChild(doc.createComment(" Autogenerated by JDBCToXMLSchema! "));

        try
        {
            generateXML();
View Full Code Here

* @version $Id: DOMGenerate.java,v 1.3.2.1 2000/12/22 10:50:33 andyc Exp $
*/
public class DOMGenerate {
    public static void main( String[] argv ) {
        try {
            Document doc= new DocumentImpl();
            Element root = doc.createElement("person");     // Create Root Element
            Element item = doc.createElement("name");       // Create element
            item.appendChild( doc.createTextNode("Jeff") );
            root.appendChild( item );                       // atach element to Root element
            item = doc.createElement("age");                // Create another Element
            item.appendChild( doc.createTextNode("28" ) );      
            root.appendChild( item );                       // Attach Element to previous element down tree
            item = doc.createElement("height");           
            item.appendChild( doc.createTextNode("1.80" ) );
            root.appendChild( item );                       // Attach another Element - grandaugther
            doc.appendChild( root );                        // Add Root to Document


            OutputFormat    format  = new OutputFormat( doc );   //Serialize DOM
            StringWriter  stringOut = new StringWriter();        //Writer will be a String
            XMLSerializer    serial = new XMLSerializer( stringOut, format );
            serial.asDOMSerializer();                            // As a DOM Serializer

            serial.serialize( doc.getDocumentElement() );

            System.out.println( "STRXML = " + stringOut.toString() ); //Spit out DOM as a String
        } catch ( Exception ex ) {
            ex.printStackTrace();
        }
View Full Code Here

        }
        else {
            sendIndentedElement("psv:annotation");
            // We can't get all the information from DOM, but I've outputed what
            // we can get -- PJM
            Node dom = new DocumentImpl();
            ann.writeAnnotation(dom, XSAnnotation.W3C_DOM_DOCUMENT);

            // this child will be the annotation element
            Element annot = DOMUtil.getFirstChildElement(dom);
View Full Code Here

        }
        else {
            sendIndentedElement("psv:annotation");
            // We can't get all the information from DOM, but I've outputed what
            // we can get -- PJM
            Node dom = new DocumentImpl();
            ann.writeAnnotation(dom, XSAnnotation.W3C_DOM_DOCUMENT);

            // this child will be the annotation element
            Element annot = DOMUtil.getFirstChildElement(dom);
View Full Code Here

    throws XNIException {

        fLocator = locator;
        if (!fDeferNodeExpansion) {
            if (fDocumentClassName.equals (DEFAULT_DOCUMENT_CLASS_NAME)) {
                fDocument = new DocumentImpl ();
                fDocumentImpl = (CoreDocumentImpl)fDocument;
                // REVISIT: when DOM Level 3 is REC rely on Document.support
                //          instead of specific class
                // set DOM error checking off
                fDocumentImpl.setStrictErrorChecking (false);
View Full Code Here

     */
    public void startDocument(XMLLocator locator, String encoding)
        throws XNIException {

        fInDocument = true;
        fDocument = new DocumentImpl();
        fDocumentImpl = (DocumentImpl)fDocument;
        fCurrentNode = fDocument;
        // set DOM error checking off
        fDocumentImpl.setErrorChecking(false);

View Full Code Here

     * @throws XNIException Thrown by handler to signal an error.
     */
    public void doctypeDecl(String rootElement, String publicId, String systemId)
        throws XNIException {
       
        DocumentImpl docimpl = (DocumentImpl)fDocument;
        DocumentType doctype = docimpl.createDocumentType(rootElement, publicId, systemId);
        fCurrentNode.appendChild(doctype);

    } // doctypeDecl(String,String,String)
View Full Code Here

* @version $Id: DOMGenerate.java,v 1.5 2002/01/29 01:15:05 lehors Exp $
*/
public class DOMGenerate {
    public static void main( String[] argv ) {
        try {
            Document doc= new DocumentImpl();
            Element root = doc.createElement("person");     // Create Root Element
            Element item = doc.createElement("name");       // Create element
            item.appendChild( doc.createTextNode("Jeff") );
            root.appendChild( item );                       // atach element to Root element
            item = doc.createElement("age");                // Create another Element
            item.appendChild( doc.createTextNode("28" ) );      
            root.appendChild( item );                       // Attach Element to previous element down tree
            item = doc.createElement("height");           
            item.appendChild( doc.createTextNode("1.80" ) );
            root.appendChild( item );                       // Attach another Element - grandaugther
            doc.appendChild( root );                        // Add Root to Document


            OutputFormat    format  = new OutputFormat( doc );   //Serialize DOM
            StringWriter  stringOut = new StringWriter();        //Writer will be a String
            XMLSerializer    serial = new XMLSerializer( stringOut, format );
            serial.asDOMSerializer();                            // As a DOM Serializer

            serial.serialize( doc.getDocumentElement() );

            System.out.println( "STRXML = " + stringOut.toString() ); //Spit out DOM as a String
        } catch ( Exception ex ) {
            ex.printStackTrace();
        }
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.