Package nokogiri.internals

Examples of nokogiri.internals.SaveContextVisitor


        IRubyObject indentString = args[2];
        IRubyObject options = args[3];

        String encString = encoding.isNil() ? null : rubyStringToString(encoding);

        SaveContextVisitor visitor =
            new SaveContextVisitor((Integer) options.toJava(Integer.class), rubyStringToString(indentString), encString, isHtmlDoc(context), isFragment(), 0);
        accept(context, visitor);

        IRubyObject rubyString = null;
        if (NokogiriHelpers.isUTF8(encString)) {
            rubyString = stringOrNil(context.getRuntime(), visitor.toString());
        } else {
            try {
                byte[] bytes = NokogiriHelpers.convertEncoding(Charset.forName(encString), visitor.toString());
                rubyString = stringOrNil(context.getRuntime(), bytes);
            } catch (CharacterCodingException e) {
                throw context.getRuntime().newRuntimeError(e.getMessage());
            }
        }
View Full Code Here

TOP

Related Classes of nokogiri.internals.SaveContextVisitor

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.