Package org.jdom.transform

Examples of org.jdom.transform.JDOMSource


      try {
        Document doc = new Document((Element) element.clone());

      Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(Options.getXSLT()));
        //Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(getXSLT()));
        JDOMSource in = new JDOMSource(doc);
        JDOMResult out = new JDOMResult();
        transformer.transform(in, out);

        List result = out.getResult();
View Full Code Here


  public static void saveXML(Document doc,String filename) {   

    try {
      //system.out.println("********************************************************************");
      JDOMSource in = new JDOMSource(doc);
      Format format = Format.getPrettyFormat();
      //format.setEncoding(encoding);     
      XMLOutputter outp = new XMLOutputter(format);         
      File f = new File(filename);
      outp.output(in.getDocument(), new FileWriter(f));     
      //system.out.println("xml datei wurde gespeichert: " + f.getCanonicalPath());
      //system.out.println("********************************************************************");
    } catch (Exception e) {
      try {
        new ErrorLog("error in " + sos.util.SOSClassUtil.getMethodName() + " .Could not save file " + filename , e);
View Full Code Here

        try {
            SAXBuilder builder = new SAXBuilder(false);
            Document doc = builder.build(input);
            if(verifySchema) {
                Validator validator = this.schema.newValidator();
                validator.validate(new JDOMSource(doc));
            }
            Element root = doc.getRootElement();
            if(!root.getName().equals(CLUSTER_ELMT))
                throw new MappingException("Invalid root element: "
                                           + doc.getRootElement().getName());
View Full Code Here

            SAXBuilder builder = new SAXBuilder();
            Document doc = builder.build(input);
            if(verifySchema) {
                Validator validator = schema.newValidator();
                validator.validate(new JDOMSource(doc));
            }
            Element root = doc.getRootElement();
            if(!root.getName().equals(STORES_ELMT))
                throw new MappingException("Invalid root element: "
                                           + doc.getRootElement().getName());
View Full Code Here

    TransformerFactory tFactory = TransformerFactory.newInstance();

    try {
      Transformer transformer = tFactory.newTransformer(streamSrc);
      JDOMResult jdomRes = new JDOMResult();
      JDOMSource jdomSrc = new JDOMSource(inputXML);
      transformer.transform(jdomSrc, jdomRes);

      outputXML = jdomRes.getDocument();
    }
    catch(TransformerConfigurationException e) {
View Full Code Here

           
            // Setup JAXP using identity transformer
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer(); // identity transformer
            // Setup input stream
            JDOMSource src = new JDOMSource(fo);
           
            // Resulting SAX events (the generated FO) must be piped through to FOP
            Result res = new SAXResult(fop.getDefaultHandler());
           
            // Start XSLT transformation and FOP processing
View Full Code Here

           
            // Setup JAXP using identity transformer
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer(); // identity transformer
            // Setup input stream
            JDOMSource src = new JDOMSource(fo);
           
            // Resulting SAX events (the generated FO) must be piped through to FOP
            Result res = new SAXResult(fop.getDefaultHandler());
           
            // Start XSLT transformation and FOP processing
View Full Code Here

    private Transformer transformer;

    public Value process(Value input, Context context) throws Exception {
      Document document = ((DocumentValue)input).getDocument();
        JDOMResult result = new JDOMResult();
        transformer.transform(new JDOMSource(document), result);
        return new DocumentValue(result.getDocument());
    }
View Full Code Here

         XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
         String logFileName = helper.getLogFileName();
         LOG.info("Transforming the log file: " + logFileName + " to: " + path + " using the xslt: " + this.xsltFile);

         //perform the transform, writing out the results to the output location
         transformer.transform(new JDOMSource(cruisecontrolLog), new StreamResult(out));

      } catch (TransformerException te) {
         throw new CruiseControlException("An error occurred during the transformation process", te);
      } catch (Exception ioe) {
         throw new CruiseControlException("An unexpected exception occurred, unable to publish the log file.", ioe);
View Full Code Here

     * @param xmlParam
     * @throws Exception
     */
    public static void transformWithXmlParam(Element xml, Source xslt, Result result,
                                             String xmlParamName, String xmlParam) throws Exception {
        Source srcXml   = new JDOMSource(new Document((Element)xml.detach()));

        // Dear old saxon likes to yell loudly about each and every XSLT 1.0
        // stylesheet so switch it off but trap any exceptions because this
        // code is run on transformers other than saxon
        TransformerFactory transFact;
View Full Code Here

TOP

Related Classes of org.jdom.transform.JDOMSource

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.