Examples of DocumentFactory


Examples of org.dom4j.DocumentFactory

      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

Examples of org.dom4j.DocumentFactory

    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

Examples of org.dom4j.DocumentFactory

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

Examples of org.dom4j.DocumentFactory

  }

  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

Examples of org.dom4j.DocumentFactory

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

Examples of org.dom4j.DocumentFactory

  }

  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

Examples of org.dom4j.DocumentFactory

  }

    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

Examples of org.dom4j.DocumentFactory

    @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

Examples of org.dom4j.DocumentFactory

  }

  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

Examples of org.dom4j.DocumentFactory

    /**
     * @since 1.4
     */
    public Dom4JDriver(final NameCoder nameCoder) {
        this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
        outputFormat.setTrimText(false);
    }
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.