Examples of XMLTokenStream


Examples of org.apache.tapestry5.internal.services.XMLTokenStream

            MappedConfigurationStub<String, URL> parserUrlMap=new MappedConfigurationStub<String, URL>();
           
            String unicodeString="\u00FC";
           
            String testDocument="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>"+unicodeString+"</root>\n";
            XMLTokenStream xts=new XMLTokenStream(new ResourceStub(testDocument.getBytes("utf-8")),parserUrlMap);
            xts.parse();
            Assert.assertEquals(xts.next(), XMLTokenType.START_ELEMENT);
            Assert.assertEquals(xts.getLocalName(), "root");
            Assert.assertEquals(xts.next(), XMLTokenType.CHARACTERS);
            Assert.assertEquals(xts.getText(), unicodeString);
            Assert.assertEquals(xts.next(), XMLTokenType.END_ELEMENT);
            Assert.assertEquals(xts.next(), XMLTokenType.END_DOCUMENT);
        }
        finally
        {
            System.setProperty("file.encoding", oldEncoding);
            resetDefaultCharset();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.