/* * Created on Jan 21, 2013 by Nick * */ package jmsltestsuite; import java.io.*; import java.util.Hashtable; import com.softsynth.util.XMLListener; import com.softsynth.util.XMLReader; public class UnicodeXMLTest { public static void main(String[] args) { FileInputStream stream; try { // stream = new FileInputStream(new File("D:/documents/JMSLScoreWork/unicode/unicode nonsense.XML")); // stream = new FileInputStream(new File("D:/documents/JMSLScoreWork/unicode/unicode nonsense2.XML")); // stream = new FileInputStream(new File("D:/documents/JMSLScoreWork/unicode/unicode_text.xml")); // stream = new FileInputStream(new File("D:/documents/JMSLScoreWork/unicode/unicode nonsense good.XML")); stream = new FileInputStream(new File("D:/documents/JMSLScoreWork/unicode/unicode nonsense good SAVED.XML")); XMLReader xmlr = new XMLReader(stream); xmlr.setXMLListener(new XMLListener() { int tabs = 0; void printTabs() { for (int i = 0; i < tabs; i++) { System.out.print("\t"); } } public void foundContent(String content) { printTabs(); System.out.println("found content: " + content); } public void endElement(String tag) { printTabs(); System.out.println("end element: " + tag); tabs--; } public void beginElement(String tag, Hashtable attributes, boolean ifEmpty) { tabs++; printTabs(); System.out.println("beginElement: " + tag); } }); xmlr.parse(); xmlr.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }