Package org.dom4j

Examples of org.dom4j.Namespace


   */
  public boolean save(OutputStream outStream) {
    Document xmlOutDoc = DocumentHelper.createDocument();

    // Building namespace
    Namespace dfNs = Namespace.get("", TYPES_NAMESPACE_URI);
    Element typesElem = xmlOutDoc
        .addElement(new QName(TYPES_TAG_NAME, dfNs));

    // Adding default types
    for (Entry<String, String> entry : defaultContentType.entrySet()) {
View Full Code Here


    // Check the current element
    @SuppressWarnings("unchecked")
    List<Namespace> declaredNamespaces = el.declaredNamespaces();
    Iterator<Namespace> itNS = declaredNamespaces.iterator();
    while (itNS.hasNext()) {
      Namespace ns = itNS.next();

      // Rule M4.2
      if (ns.getURI().equals(PackageNamespaces.MARKUP_COMPATIBILITY))
        throw new InvalidFormatException(
            "OPC Compliance error [M4.2]: A format consumer shall consider the use of the Markup Compatibility namespace to be an error.");
    }

    // Rule M4.3
View Full Code Here

                .createPart(
                        corePartName,
                        "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");

        Document doc = DocumentHelper.createDocument();
        Namespace nsWordprocessinML = new Namespace("w",
                "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
        Element elDocument = doc.addElement(new QName("document",
                nsWordprocessinML));
        Element elBody = elDocument.addElement(new QName("body",
                nsWordprocessinML));
View Full Code Here

              .getTargetURI())));
    }

    // Create a content
    Document doc = DocumentHelper.createDocument();
    Namespace nsWordprocessinML = new Namespace("w",
        "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    Element elDocument = doc.addElement(new QName("document",
        nsWordprocessinML));
    Element elBody = elDocument.addElement(new QName("body",
        nsWordprocessinML));
View Full Code Here

                .createPart(
                        corePartName,
                        "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");

        Document doc = DocumentHelper.createDocument();
        Namespace nsWordprocessinML = new Namespace("w",
                "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
        Element elDocument = doc.addElement(new QName("document",
                nsWordprocessinML));
        Element elBody = elDocument.addElement(new QName("body",
                nsWordprocessinML));
View Full Code Here

              .getTargetURI())));
    }

    // Create a content
    Document doc = DocumentHelper.createDocument();
    Namespace nsWordprocessinML = new Namespace("w",
        "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    Element elDocument = doc.addElement(new QName("document",
        nsWordprocessinML));
    Element elBody = elDocument.addElement(new QName("body",
        nsWordprocessinML));
View Full Code Here

                .createPart(
                        corePartName,
                        "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");

        Document doc = DocumentHelper.createDocument();
        Namespace nsWordprocessinML = new Namespace("w",
                "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
        Element elDocument = doc.addElement(new QName("document",
                nsWordprocessinML));
        Element elBody = elDocument.addElement(new QName("body",
                nsWordprocessinML));
View Full Code Here

              .getTargetURI())));
    }

    // Create a content
    Document doc = DocumentHelper.createDocument();
    Namespace nsWordprocessinML = new Namespace("w",
        "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    Element elDocument = doc.addElement(new QName("document",
        nsWordprocessinML));
    Element elBody = elDocument.addElement(new QName("body",
        nsWordprocessinML));
View Full Code Here

                       
                        if ( value != null )
                        {
                            if ( ParserUtils.needsBase64Encoding( value ) )
                            {
                                Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI );
                                Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI );
                                element.getDocument().getRootElement().add( xsdNamespace );
                                element.getDocument().getRootElement().add( xsiNamespace );

                                Element valueElement = modElement.addElement( "value" ).addText( ParserUtils.base64Encode( value ) );
                                valueElement
View Full Code Here

                    {
                        Object value = ne2.nextElement();
   
                        if ( ParserUtils.needsBase64Encoding( value ) )
                        {
                            Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI );
                            Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI );
                            attributeElement.getDocument().getRootElement().add( xsdNamespace );
                            attributeElement.getDocument().getRootElement().add( xsiNamespace );
   
                            Element valueElement = attributeElement.addElement( "value" ).addText(
                                ParserUtils.base64Encode( value ) );
View Full Code Here

TOP

Related Classes of org.dom4j.Namespace

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.