Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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 IList <Dictionary <String, Object> > ImportFromXML(TextReader inp)
        {
            SimpleBookmark book = new SimpleBookmark();

            SimpleXMLParser.Parse(book, inp);
            return(book.topList);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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 {}
     }
 }
Ejemplo n.º 7
0
        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());
        }
Ejemplo n.º 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{}
         }
     }
Ejemplo n.º 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);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }