Package org.jdom2.input

Examples of org.jdom2.input.StAXEventBuilder

From a JDOM perspective XMLStreamReaders are more efficient than XMLEventReaders. Where possible use an XMLStreamReader.

If you happen to be looking at the source code, pay careful attention to the imports so you know what type of instance is being processed, whether it is a StAX class, or a JDOM class, because there are name conflicts. @author Rolf Lear


   */
  private void saveXML()
  {
     try
     {
        XMLOutputter sortie = new XMLOutputter(Format.getPrettyFormat());
        sortie.output(this.root, new FileOutputStream(SQCalculator.xmlPath));
     }
     catch (java.io.IOException e){}
  }
View Full Code Here


   */
  private void saveXML()
  {
     try
     {
        XMLOutputter sortie = new XMLOutputter(Format.getPrettyFormat());
        sortie.output(la.root, new FileOutputStream(Language.xmlPath));
     }
     catch (java.io.IOException e){}
  }
View Full Code Here

                  SemCorCleaner.checkSenses(word, l);
                }
              }
            }         
          }
          XMLOutputter xmlOutput = new XMLOutputter();
          //display nice
          xmlOutput.setFormat(Format.getPrettyFormat());
          xmlOutput.output(xml, new FileWriter(file));
          System.out.println("------------Correction finished for "+file.getName()+"-------------------------");
        }
        catch(JDOMException e)
        {
          file.deleteOnExit();
View Full Code Here

     @return HTML
     */
    public static String element2String( Element element )
    {
        Document document = new Document( element );
        XMLOutputter outputter = new XMLOutputter();
        return outputter.outputString( document );
    }
View Full Code Here

        throws IOException
    {
        m_document.setContext( m_context );

        CustomXMLOutputProcessor processor = new CustomXMLOutputProcessor();
        XMLOutputter output = new XMLOutputter(processor);
       
        StringWriter out = new StringWriter();
       
        Format fmt = Format.getRawFormat();
        fmt.setExpandEmptyElements( false );
        fmt.setLineSeparator( LINEBREAK );

        output.setFormat( fmt );
        output.outputElementContent( m_document.getRootElement(), out );
       
        String result = out.toString();
        return result;
    }
View Full Code Here

                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
        }
        // we have no other option than to transform
        JDOMResult jdomResult = new JDOMResult();
        transform(requestPayload, jdomResult);
        return jdomResult.getDocument().getRootElement();
    }
View Full Code Here

                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
        }
        // we have no other option than to transform
        JDOMResult jdomResult = new JDOMResult();
        transform(source, jdomResult);
        return jdomResult.getDocument().getRootElement();
    }
View Full Code Here

    }

    @Override
    protected Source createResponsePayload(MethodParameter returnType, Object returnValue) {
        Element returnedElement = (Element) returnValue;
        return new JDOMSource(returnedElement);
    }
View Full Code Here

    @Override
    public final Source invoke(Source request) throws Exception {
        Element requestElement = getDocumentElement(request);
        Element responseElement = invokeInternal(requestElement);
        return responseElement != null ? new JDOMSource(responseElement) : null;
    }
View Full Code Here

    {
        StringBuffer sb = new StringBuffer();
       
        try
        {
            XPath xp = XPath.newInstance( ALL_TEXT_NODES );
       
            List nodes = xp.selectNodes(m_document.getDocument());
           
            for( Iterator i = nodes.iterator(); i.hasNext(); )
            {
                Object el = i.next();
               
View Full Code Here

TOP

Related Classes of org.jdom2.input.StAXEventBuilder

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.