Package org.jdom.output

Examples of org.jdom.output.SAXOutputter


    public DocumentReader(Document doc) {
        this.doc = doc;
    }

    public void parse(InputSource input) throws SAXException, IOException {
        SAXOutputter outputter = new SAXOutputter(this, this, this, this, this);
        try {
            outputter.output(doc);
        }
        catch (JDOMException ex) {
            throw new SAXException(ex);
        }
    }
View Full Code Here


                throw new ResourceNotFoundException("Unable to locate object.");
            }
           
           
            // Instantiate and execute the ORE plugin
            SAXOutputter out = new SAXOutputter(contentHandler);
            DisseminationCrosswalk xwalk = (DisseminationCrosswalk)PluginManager.getNamedPlugin(DisseminationCrosswalk.class,"ore");
           
            Element ore = xwalk.disseminateElement(item);
            out.output(ore);
           
      /* Generate the METS document
      contentHandler.startDocument();
      adapter.renderMETS(contentHandler,lexicalHandler);
      contentHandler.endDocument();*/
 
View Full Code Here

 
          SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler, namespaces);
          // Allow the basics for XML
          filter.allowElements().allowIgnorableWhitespace().allowCharacters().allowCDATA().allowPrefixMappings();
         
              SAXOutputter outputter = new SAXOutputter();
              outputter.setContentHandler(filter);
              outputter.setLexicalHandler(filter);
        outputter.output(dissemination);
      }
            catch (JDOMException jdome)
      {
        throw new WingException(jdome);
      }
View Full Code Here

          // Special option, only allow elements below the second level to pass through. This
          // will trim out the METS declaration and only leave the actual METS parts to be
          // included.
          filter.allowElements(1);
         
              SAXOutputter outputter = new SAXOutputter();
              outputter.setContentHandler(filter);
              outputter.setLexicalHandler(filter);
              try {
                outputter.output(xmlDocument);
              }
              catch (JDOMException jdome)
              {
                // serialization failed so let's just fallback sending the plain characters.
                sendCharacters(value);
View Full Code Here

       
                        SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler, namespaces);
                        // Allow the basics for XML
                        filter.allowElements().allowIgnorableWhitespace().allowCharacters().allowCDATA().allowPrefixMappings();
                       
                    SAXOutputter outputter = new SAXOutputter();
                    outputter.setContentHandler(filter);
                    outputter.setLexicalHandler(filter);
                                outputter.output(dissemination);
                        }
            catch (JDOMException jdome)
                        {
                                throw new WingException(jdome);
                        }
View Full Code Here

            SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler, namespaces);
            // Allow the basics for XML
            filter.allowElements().allowIgnorableWhitespace().allowCharacters().allowCDATA().allowPrefixMappings();

            SAXOutputter outputter = new SAXOutputter();
            outputter.setContentHandler(filter);
            outputter.setLexicalHandler(filter);
            outputter.output(dissemination);
        }
        catch (JDOMException jdome)
        {
            throw new WingException(jdome);
        }
View Full Code Here

            "Error translating HTML fragment into DRI", e);
      }

      SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler,
          namespaces);
      SAXOutputter outputter = new SAXOutputter();
      outputter.setContentHandler(filter);
      outputter.setLexicalHandler(filter);

      Element root = document.getRootElement();

      @SuppressWarnings("unchecked")
      // This cast is correct
      List<Element> children = root.getChildren();
      for (Element child : children) {
        outputter.output(child);
      }

    } catch (JDOMException e) {
                        // If we are here, then a parsing error occurred within the XHTML fragment.  We'll just assume
                        // that this is not supposed to be XHTML and display the fragment as plain text within <dri:p> tags.
View Full Code Here

TOP

Related Classes of org.jdom.output.SAXOutputter

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.