// Path: core/src/main/java/org/wandledi/io/MagicReader.java
// public class MagicReader extends Reader {
// 
//     public static final char MAGIC_CHARACTER = (char) 5;
// 
//     private Reader in;
// 
//     public MagicReader(Reader in) {
//         this.in = in;
//     }
// 
//     protected void hideAllIn(char[] chars, int offset, int length) {
//         for (int i = offset; i < offset + length; ++i) {
//             if (chars[i] == '&') {
//                 chars[i] = MAGIC_CHARACTER;
//             }
//         }
//     }
// 
//     public void showAllIn(char[] chars, int offset, int length) {
//         for (int i = offset; i < offset + length; ++i) {
//             if (chars[i] == MAGIC_CHARACTER) {
//                 chars[i] = '&';
//             }
//         }
//     }
// 
//     @Override
//     public int read(char[] chars, int offset, int length) throws IOException {
//         int read = in.read(chars, offset, length);
//         hideAllIn(chars, offset, read);
//         return read;
//     }
// 
//     @Override
//     public void close() throws IOException {
//         in.close();
//     }
// }


import org.wandledi.*;
import org.wandledi.io.MagicReader;
import org.wandledi.spells.*;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.*;
import java.util.*;
import static org.testng.Assert.*;
            }
        });
        random = new Random();
    }

    public String wandle(String file) {
        StringWriter output = new StringWriter();
        FileReader input = null;
        try {
            input = new FileReader(DIR + file);
            wandler.useScroll(page.getScroll());
            wandler.wandle(input, output);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (input != null) {
                try { input.close(); } catch (IOException e) { }
            }
        }
        return output.toString();
    }

    public static Document parseXML(String xml) {
        try {
            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();

            return builder.parse(new InputSource(new StringReader(xml)));
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
        } catch (SAXException e) {
// Path: core/src/main/java/org/wandledi/io/MagicReader.java
// public class MagicReader extends Reader {
// 
//     public static final char MAGIC_CHARACTER = (char) 5;
// 
//     private Reader in;
// 
//     public MagicReader(Reader in) {
//         this.in = in;
//     }
// 
//     protected void hideAllIn(char[] chars, int offset, int length) {
//         for (int i = offset; i < offset + length; ++i) {
//             if (chars[i] == '&') {
//                 chars[i] = MAGIC_CHARACTER;
//             }
//         }
//     }
// 
//     public void showAllIn(char[] chars, int offset, int length) {
//         for (int i = offset; i < offset + length; ++i) {
//             if (chars[i] == MAGIC_CHARACTER) {
//                 chars[i] = '&';
//             }
//         }
//     }
// 
//     @Override
//     public int read(char[] chars, int offset, int length) throws IOException {
//         int read = in.read(chars, offset, length);
//         hideAllIn(chars, offset, read);
//         return read;
//     }
// 
//     @Override
//     public void close() throws IOException {
//         in.close();
//     }
// }


// Path: core/src/test/java/wandledi/test/HTML5.java
import org.wandledi.*;
import org.wandledi.io.MagicReader;
import org.wandledi.spells.*;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.*;
import java.util.*;
import static org.testng.Assert.*;

            }
        });
        random = new Random();
    }

    public String wandle(String file) {
        StringWriter output = new StringWriter();
        FileReader input = null;
        try {
            input = new FileReader(DIR + file);
            wandler.useScroll(page.getScroll());
            wandler.wandle(input, output);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (input != null) {
                try { input.close(); } catch (IOException e) { }
            }
        }
        return output.toString();
    }

    public static Document parseXML(String xml) {
        try {
            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();

            return builder.parse(new InputSource(new StringReader(xml)));
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
        } catch (SAXException e) {
            e.printStackTrace();