2003/11/29 03:06:10
[org.ibex.core.git] / src / org / xwt / translators / HTML.java
index 4801971..6aa8ba2 100644 (file)
@@ -50,7 +50,7 @@ public class HTML {
     /** true iff we have encountered an LI more recently than the last OL/UL */
     private static boolean withinLI = false;
 
-    public static synchronized JS parseReader(Reader r) throws IOException {
+    public static synchronized JS parseReader(Reader r) throws IOException, JSExn {
         CharStream cs = new CharStream(r);
         JS h = new JS();
 
@@ -84,7 +84,7 @@ public class HTML {
      *  facilitate correcting broken HTML. Otherwise, this returns
      *  null.
      */
-    private static String parseElement(CharStream cs, JS h) throws IOException {
+    private static String parseElement(CharStream cs, JS h) throws IOException, JSExn {
         // scan element name
         while(Character.isSpace(cs.peek())) cs.get();
         String elementName = parseElementName(cs);
@@ -135,7 +135,7 @@ public class HTML {
      *  positioned at the character immediately after the right
      *  bracket closing the start-tag
      */
-    private static String parseBody(CharStream cs, JS h, String elementName) throws IOException {
+    private static String parseBody(CharStream cs, JS h, String elementName) throws IOException, JSExn {
         String cdata = "";
         int length = h.get("$numchildren") == null ? 0 : Integer.parseInt(h.get("$numchildren").toString());
         while(true) {
@@ -187,7 +187,7 @@ public class HTML {
     /** Parses an element name and returns it. The CharStream should
      *  be positioned at the first character of the name.
      */
-    private static String parseElementName(CharStream cs) throws IOException {
+    private static String parseElementName(CharStream cs) throws IOException, JSExn {
         String ret = "";
         while (cs.peek() != '>' && !Character.isSpace(cs.peek())) ret += cs.get();
         return ret.toLowerCase();
@@ -197,7 +197,7 @@ public class HTML {
      *  be positioned at the first character of the name, possibly
      *  with intervening whitespace.
      */
-    private static String parseAttributeName(CharStream cs) throws IOException {
+    private static String parseAttributeName(CharStream cs) throws IOException, JSExn {
         while(Character.isSpace(cs.peek())) cs.get();
         String ret = "";
         while(!Character.isSpace(cs.peek()) && cs.peek() != '=' && cs.peek() != '>') ret += cs.get();
@@ -208,7 +208,7 @@ public class HTML {
      *  should be positioned at the equals sign, possibly with
      *  intervening whitespace.
      */
-    private static String parseAttributeValue(CharStream cs) throws IOException {
+    private static String parseAttributeValue(CharStream cs) throws IOException, JSExn {
 
         // eat whitespace and equals sign
         while(Character.isSpace(cs.peek())) cs.get();
@@ -236,7 +236,7 @@ public class HTML {
     /** Parses a comment and returns its body. The CharStream should
      *  be positioned immediately after the <!--
      */
-    private static String parseComment(CharStream cs) throws IOException {
+    private static String parseComment(CharStream cs) throws IOException, JSExn {
         int dashes = 0;
         String ret = "";
         while(true) {
@@ -249,7 +249,7 @@ public class HTML {
     }
 
     /** Expands all SGML entities in string <tt>s</tt> */
-    public static String expandEntities(String s) throws IOException {
+    public static String expandEntities(String s) throws IOException, JSExn {
         if (s.indexOf('&') == -1) return s;
         StringBuffer sb = new StringBuffer();
         int i=0;
@@ -283,7 +283,7 @@ public class HTML {
     }
 
     /** removes all redundant whitespace */
-    private static String removeRedundantWhitespace(String s) {
+    private static String removeRedundantWhitespace(String s) throws JSExn {
 
         if (s.indexOf(' ') == -1 && s.indexOf('\n') == -1 && s.indexOf('\t') == -1 && s.indexOf('\r') == -1) return s;