示例#1
0
        /**
         * Import the names from XML.
         * @param inp the XML source. The reader is not closed
         * @throws IOException on error
         * @return the names
         */
        public static Dictionary <string, string> ImportFromXML(TextReader inp)
        {
            SimpleNamedDestination names = new SimpleNamedDestination();

            SimpleXMLParser.Parse(names, inp);
            return(names.xmlNames);
        }
示例#2
0
        /**
         * Import the bookmarks from XML.
         * @param in the XML source. The reader is not closed
         * @throws IOException on error
         * @return the bookmarks
         */
        public static ArrayList ImportFromXML(TextReader inp)
        {
            SimpleBookmark book = new SimpleBookmark();

            SimpleXMLParser.Parse(book, inp);
            return(book.topList);
        }
        /**
         * Import the bookmarks from XML.
         * @param in the XML source. The reader is not closed
         * @throws IOException on error
         * @return the bookmarks
         */
        public static IList <Dictionary <String, Object> > ImportFromXML(TextReader inp)
        {
            SimpleBookmark book = new SimpleBookmark();

            SimpleXMLParser.Parse(book, inp);
            return(book.topList);
        }
示例#4
0
        /**
         * Import the names from XML.
         * @param inp the XML source. The reader is not closed
         * @throws IOException on error
         * @return the names
         */
        public static Hashtable ImportFromXML(TextReader inp)
        {
            SimpleNamedDestination names = new SimpleNamedDestination();

            SimpleXMLParser.Parse(names, inp);
            return(names.xmlNames);
        }
示例#5
0
        /**
         * Static method that parses an XML Stream.
         * @param is    the XML input that needs to be parsed
         * @return  a String obtained by removing all tags from the XML
         */
        public static String Parse(Stream isp)
        {
            XmlToTxt handler = new XmlToTxt();

            SimpleXMLParser.Parse(handler, null, new StreamReader(isp), true);
            return(handler.ToString());
        }
 virtual public void Parse(Stream stream, IPatternConsumer consumer)
 {
     this.consumer = consumer;
     try {
         SimpleXMLParser.Parse(this, stream);
     }
     finally {
         try{ stream.Close(); }catch {}
     }
 }
        virtual public void WhitespaceHtml()
        {
            String whitespace = "<p>sometext\r moretext</p>";
            String expected   = "sometext moretext";

            SimpleXMLDocHandlerTest docHandler = new SimpleXMLDocHandlerTest();

            SimpleXMLParser.Parse(docHandler, null, new StringReader(whitespace), true);
            Assert.AreEqual(expected, docHandler.b.ToString());
        }
示例#8
0
 /** Reads an XFDF form.
     * @param filename the file name of the form
     * @throws IOException on error
     */    
     public XfdfReader(String filename) {
         FileStream fin = null;
         try {
             fin = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
             SimpleXMLParser.Parse(this, fin);
         }
         finally {
             try{if (fin != null) fin.Close();}catch{}
         }
     }
示例#9
0
 /**
  * Parses content read from a java.io.Reader object.
  * @param reader    the content
  * @throws IOException
  */
 public void Parse(TextReader reader)
 {
     SimpleXMLParser.Parse(this, null, reader, true);
 }
示例#10
0
 /** Reads an XFDF form.
  * @param xfdfIn the byte array with the form
  * @throws IOException on error
  */
 public XfdfReader(byte[] xfdfIn)
 {
     SimpleXMLParser.Parse(this, new MemoryStream(xfdfIn));
 }
示例#11
0
 /**
  * Reads an XFDF form.
  * @param is an InputStream to read the form
  * @throws IOException on error
  * @since 5.0.1
  */
 public XfdfReader(Stream isp)
 {
     SimpleXMLParser.Parse(this, isp);
 }
示例#12
0
 /**
  * Parses content read from a java.io.Reader object.
  * @param reader    the content
  * @throws IOException
  */
 virtual public void Parse(TextReader reader)
 {
     LOGGER.Info("Please note, there is a more extended version of the HTMLWorker available in the iText XMLWorker");
     SimpleXMLParser.Parse(this, null, reader, true);
 }