Java XML Transform Usage getXmlEventWriter(Result r)

Here you can find the source of getXmlEventWriter(Result r)

Description

get Xml Event Writer

License

Apache License

Declaration

public static XMLEventWriter getXmlEventWriter(Result r) throws Exception 

Method Source Code

//package com.java2s;
/*/*ww  w .ja v a  2s.c  o m*/
 * Copyright 2006-2007 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import javax.xml.stream.XMLEventWriter;
import javax.xml.transform.Result;

import java.lang.reflect.Method;

public class Main {
    public static XMLEventWriter getXmlEventWriter(Result r) throws Exception {
        Method m = r.getClass().getDeclaredMethod("getXMLEventWriter", new Class[] {});
        boolean accessible = m.isAccessible();
        m.setAccessible(true);
        Object result = m.invoke(r);
        m.setAccessible(accessible);
        return (XMLEventWriter) result;
    }
}

Related

  1. getSourceFromEndpointReference(EndpointReference epr)
  2. getStreamSources(File[] stylesheets)
  3. getTemplatesByName(File xslF)
  4. getWSAAddress(W3CEndpointReference ref)
  5. getXMLCalendar(Date date)
  6. longToGregorian(long date)
  7. map2Xml(Map map)
  8. newSchema(File xmlSchema)
  9. newSchema(Source[] schemas)