Package javax.xml.transform

Examples of javax.xml.transform.Source


  }

  public CatalogBuilder parseIntoBuilder( InputStream is, URI docBaseUri )
          throws ThreddsXmlParserException
  {
    Source source = new StreamSource( is, docBaseUri.toString() );
    return readCatalogXML( source );
  }
View Full Code Here


                    Object aXslInput,
                    Object aHtmlOutput,
                    Hashtable aParamList)
        throws IllegalArgumentException
  {
      Source tXmlSource = null;
      Source tXslSource = null;
      Result tOutputTarget = null;

      // test and convert the flexible parameters
        if (aXmlInput instanceof Node) {
            // aXmlInput is a DOM object
View Full Code Here

        callback = cb;
    }

    public Object read(int idx, T input) {
        SOAPMessage src = (SOAPMessage)input;
        Source obj = null;
        try {
            if (DOMSource.class.isAssignableFrom(callback.getSupportedFormats()[0])) {
               
                obj = new DOMSource(src.getSOAPPart());
               
View Full Code Here

    public SOAPBodyDataReader(DynamicDataBindingCallback cb) {
        callback = cb;
    }

    public Object read(int idx, T input) {
        Source obj = null;       
        SOAPBody src = (SOAPBody)input;   
        try {
            Document doc = src.extractContentAsDocument();
            assert doc != null;
   
View Full Code Here

    {
        try
        {
            if (StringUtils.isNotBlank(xmlDocument))
            {
                final Source xmlSource = new DOMSource(this.urlToDocument(xmlDocument));
                final TransformerFactory factory = TransformerFactory.newInstance();
                final URL xslt = new File(transformation).toURL();
                if (xslt != null)
                {
                    final Source xsltSource = new StreamSource(xslt.openStream());
                    final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
                    final ByteArrayOutputStream output = new ByteArrayOutputStream();
                    final Result result = new StreamResult(output);
                    transformer.transform(
                        xmlSource,
View Full Code Here

            if (StringUtils.isNotBlank(modelUri))
            {
                final URL modelUrl = new URL(modelUri);
                if (xsltTransformations != null && xsltTransformations.length > 0)
                {
                    Source modelSource = new StreamSource(modelUrl.openStream());
                    final List xslts = Arrays.asList(xsltTransformations);
                    final TransformerFactory factory = TransformerFactory.newInstance();
                    final TransformerURIResolver resolver = new TransformerURIResolver();
                    factory.setURIResolver(resolver);
                    for (final Iterator xsltIterator = xslts.iterator(); xsltIterator.hasNext();)
                    {
                        final Transformation transformation = (Transformation)xsltIterator.next();
                        final URL xslt = new URL(transformation.getUri());
                        resolver.setLocation(xslt);
                        if (xslt != null)
                        {
                            AndroMDALogger.info("Applying transformation --> '" + xslt + "'");
                            final Source xsltSource = new StreamSource(xslt.openStream());
                            final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
                            final ByteArrayOutputStream output = new ByteArrayOutputStream();
                            final Result result = new StreamResult(output);
                            transformer.transform(modelSource, result);
                            final byte[] outputResult = output.toByteArray();
View Full Code Here

        public Source resolve(
            final String href,
            final String base)
            throws TransformerException
        {
            Source source = null;
            if (this.location != null)
            {
                String locationUri = ResourceUtils.normalizePath(this.location.toString());
                locationUri = locationUri.substring(0, locationUri.lastIndexOf('/') + 1);
                source = new StreamSource(locationUri + href);
View Full Code Here

    }

    public void testGetMessageContent() throws IOException {

        Source ret = clientTransport.getMessageContent(outCtx);
       
        assertNotNull(ret);
        assertEquals("incorrect return type", StreamSource.class, ret.getClass());
        InputStream in = ((StreamSource)ret).getInputStream();
        assertNotNull(in);
       
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        assertEquals(TEST_MESSAGE, reader.readLine());    
View Full Code Here

  static XMLEventReader createXmlEventReaderOnXmlString( String xml, String docBaseUri )
          throws XMLStreamException
  {
    Reader stringReader = new StringReader( xml );
    Source source = new StreamSource( stringReader, docBaseUri.toString() );
    XMLInputFactory factory = XMLInputFactory.newInstance();
    factory.setProperty( "javax.xml.stream.isCoalescing", Boolean.TRUE );
    factory.setProperty( "javax.xml.stream.supportDTD", Boolean.FALSE );

    return factory.createXMLEventReader( source );
View Full Code Here

  {
    String xml = CatalogXmlUtils.wrapThreddsXmlInCatalog( "<serviceName>OPeNDAP</serviceName>", null, null, null );
    String baseUriString = "http://test.metadata.parser/tmd.xml";

    Reader reader = new StringReader( xml );
    Source source = new StreamSource( reader, baseUriString );
    XMLEventReader eventReader = factory.createXMLEventReader( source );

    StringWriter writer = new StringWriter();

    while ( eventReader.hasNext() )
View Full Code Here

TOP

Related Classes of javax.xml.transform.Source

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.