Package org.dom4j

Examples of org.dom4j.DocumentFactory


  // Implementation methods
  // -------------------------------------------------------------------------

  protected DocumentFactory getDocumentFactory() {
    DocumentFactory factory = getQName().getDocumentFactory();

    return (factory != null) ? factory : DOCUMENT_FACTORY;
  }
View Full Code Here


   public void run()
   {
      processDir(jbossHome);
      try
      {
         DocumentFactory df = DocumentFactory.getInstance();
         Document doc = df.createDocument();
         Element root = doc.addElement("jar-versions");
         Iterator iter = jars.iterator();
         while( iter.hasNext() )
         {
            JarInfo info = (JarInfo) iter.next();
View Full Code Here

      Element element = entry.getKey();
      QName elementQName = getQNameOfSchemaElement(element);
      QName type = entry.getValue();

      if (complexTypeMap.containsKey(type)) {
        DocumentFactory factory = (DocumentFactory) complexTypeMap.get(type);
        elementQName.setDocumentFactory(factory);
      } else if (simpleTypeMap.containsKey(type)) {
        XSDatatype datatype = (XSDatatype) simpleTypeMap.get(type);
        DocumentFactory factory = (DocumentFactory) elementFactoryMap.get(element);

        if (factory instanceof DatatypeElementFactory) {
          ((DatatypeElementFactory) factory).setChildElementXSDatatype(elementQName, datatype);
        }
      }
View Full Code Here

    if (dataType != null) {
      return new DatatypeElement(qname, dataType);
    }

    DocumentFactory factory = qname.getDocumentFactory();

    if (factory instanceof DatatypeElementFactory) {
      DatatypeElementFactory dtFactory = (DatatypeElementFactory) factory;
      dataType = dtFactory.getChildElementXSDatatype(qname);
View Full Code Here

   * @param identity
   * @return Document The XML document
   */
  public Document getResDoc(AssessmentInstance ai, Locale locale, Identity identity) {
    AssessmentContext ac = ai.getAssessmentContext();
    DocumentFactory df = DocumentFactory.getInstance();
    Document res_doc = df.createDocument();
    Element root = df.createElement("qti_result_report");
    res_doc.setRootElement(root);
    Element result = root.addElement("result");
    Element extension_result = result.addElement("extension_result");

    // add items (not qti standard, but nice to display original questions ->
View Full Code Here

  }

  private static void addStaticsPath(Element el_in, AssessmentInstance ai) {
    Element el_staticspath = (Element) el_in.selectSingleNode(STATICS_PATH);
    if (el_staticspath == null) {
      DocumentFactory df = DocumentFactory.getInstance();
      el_staticspath = df.createElement(STATICS_PATH);
      Resolver resolver = ai.getResolver();
      el_staticspath.addAttribute("ident", resolver.getStaticsBaseURI());
      el_in.add(el_staticspath);
    }
  }
View Full Code Here

  /**
   * @see org.olat.core.gui.control.generic.textmarker.TextMarkerManager#saveToFile(org.olat.core.util.vfs.VFSLeaf,
   *      java.util.List)
   */
  public void saveToFile(VFSLeaf textMarkerFile, List textMarkerList) {
    DocumentFactory df = DocumentFactory.getInstance();
    Document doc = df.createDocument();
    // create root element with version information
    Element root = df.createElement(XML_ROOT_ELEMENT);
    root.addAttribute(XML_VERSION_ATTRIBUTE, String.valueOf(VERSION));
    doc.setRootElement(root);
    // add TextMarker elements
    Iterator iter = textMarkerList.iterator();
    while (iter.hasNext()) {
View Full Code Here

  }

  public static DocumentFactory getDocumentFactory() {

    ClassLoader cl = ClassLoaderHelper.getContextClassLoader();
    DocumentFactory factory;
    try {
      Thread.currentThread().setContextClassLoader( XMLHelper.class.getClassLoader() );
      factory = DocumentFactory.getInstance();
    }
    finally {
View Full Code Here

  }

    public static DocumentFactory getDocumentFactory() {

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        DocumentFactory factory;
        try {
            Thread.currentThread().setContextClassLoader( XMLHelper.class.getClassLoader() );
            factory = DocumentFactory.getInstance();
        }
        finally {
View Full Code Here

    @Override
    public Document toDocument() {
        // if (project == null) throw new NullPointerException("No project");
        assert project != null;

        DocumentFactory docFactory = new DocumentFactory();
        Document document = docFactory.createDocument();
        Dom4JXMLOutput treeBuilder = new Dom4JXMLOutput(document);

        try {
            writeXML(treeBuilder);
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.dom4j.DocumentFactory

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.