Package org.dom4j

Examples of org.dom4j.Namespace


  public CPManifest(CPCore cp, String identifier) {
    super(CPCore.MANIFEST);
    log = Logger.getLogger(CPManifest.class);
    this.identifier = identifier;
    schemaLocation = CPManifest.DEFAULT_SCHEMALOC;
    setNamespace(new Namespace("imsmd", DEFAULT_NMS));
    organizations = new CPOrganizations();
    resources = new CPResources();
    errors = new Vector<String>();
    this.cp = cp;
  }
View Full Code Here


    String simpleSeqencingUri = null;
    // get all organization elements. need to set namespace
    Element rootElement = doc.getRootElement();
    String nsuri = rootElement.getNamespace().getURI();
    // look for the adl cp namespace that differs a scorm package from a normal cp package
    Namespace nsADL = rootElement.getNamespaceForPrefix("adlcp");
    if (nsADL != null ) adluri = nsADL.getURI();
    Namespace nsADLSeq = rootElement.getNamespaceForPrefix("adlseq");
    if (nsADLSeq != null ) seqencingUri = nsADLSeq.getURI();
    Namespace nsADLSS = rootElement.getNamespaceForPrefix("imsss");
    if (nsADLSS != null ) simpleSeqencingUri = nsADLSS.getURI();
    // we can only support scorm 1.2 so far.
    if (adluri != null && !((adluri.indexOf("adlcp_rootv1p2") != -1) || (adluri.indexOf("adlcp_rootv1p3") != -1))){
      //we dont have have scorm 1.2 or 1.3 namespace so it can't be a scorm package
      throw new AddingResourceException("scorm.no.scorm.namespace");
    }
View Full Code Here

        Element argumentsListElement = argumentsPropertyElement.addElement( new QName( ServerXmlIOV152.ELEMENT_LIST,
            NAMESPACE_XBEAN_SPRING ) );

        // Adding the arguments attributes 'value' element
        Element argumentsAttributesValueElement = argumentsListElement.addElement( new QName(
            ServerXmlIOV152.ELEMENT_VALUE, new Namespace( "spring", "http://www.springframework.org/schema/beans" ) ) ); //$NON-NLS-1$ //$NON-NLS-2$

        // Creating a string buffer to contain the LDIF data
        StringBuffer sb = new StringBuffer();

        // Looping on attributes
View Full Code Here

    }
    return data;
  }

  public Element getAll(String username) {
    QName qName = new QName("", new Namespace("","jabber:iq:private"), "query");
    Element data = DocumentHelper.createElement(qName);
   
    if (enabled) {
      Connection con = null;
      PreparedStatement pstmt = null;
View Full Code Here

        }
    }

    public String getDefaultNamespaceURI()
    {
        Namespace namespace = this.document.getRootElement().getNamespace();
        return namespace.getURI();
    }
View Full Code Here

   */
  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

      ZipOutputStream zos) {
    // Building xml
    Document xmlOutDoc = DocumentHelper.createDocument();
    // make something like <Relationships
    // xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
    Namespace dfNs = Namespace.get("", PackageNamespaces.RELATIONSHIPS);
    Element root = xmlOutDoc.addElement(new QName(
        PackageRelationship.RELATIONSHIPS_TAG_NAME, dfNs));

    // <Relationship
    // TargetMode="External"
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

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.