Code example for StreamSource

Methods: getInputStream, getReader, getSystemId

0
 
        /* If it's a StreamSource, turn it into an input source and create 
         * a default parsing engine. */ 
        else if ( xsrc instanceof StreamSource ) {
            StreamSource strmsrc = (StreamSource) xsrc;
            if ( strmsrc.getInputStream() != null ) {
                insource = new InputSource( strmsrc.getInputStream() );
                insource.setSystemId( systemId );
            } 
            else if ( strmsrc.getReader() != null ) {
                insource = new InputSource( strmsrc.getReader() );
                insource.setSystemId( systemId );
            } 
            else { 
                insource = new InputSource( strmsrc.getSystemId() );
            } 
        } 
 
        /* I don't think there's any other kind of source, but if there is 
         * one we'll have to transform it to DOM using brute force. */ 
        else {