arkin       99/11/30 13:46:58

  Modified:    java/src/org/apache/xml/serialize HTMLdtd.java
  Log:
  Added isURI() check and added FRAME to list of empty elements.
  
  Revision  Changes    Path
  1.2       +17 -2     xml-xerces/java/src/org/apache/xml/serialize/HTMLdtd.java
  
  Index: HTMLdtd.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xml/serialize/HTMLdtd.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTMLdtd.java      1999/11/23 22:29:52     1.1
  +++ HTMLdtd.java      1999/11/30 21:46:58     1.2
  @@ -178,7 +178,7 @@
        */
       public static boolean isEmptyTag( String tagName )
       {
  -        // BR AREA LINK IMG PARAM HR INPUT COL BASE META BASEFONT ISINDEX
  +        // BR AREA LINK IMG PARAM HR INPUT COL BASE META BASEFONT ISINDEX 
FRAME
        /*
           return ( tagName.equals( "BR" ) || tagName.equals( "AREA" ) ||
                    tagName.equals( "LINK" ) || tagName.equals( "IMG" ) ||
  @@ -359,6 +359,21 @@
           return false;
       }
   
  +
  +    /**
  +     * Returns true if the specified attribute it a URI and should be
  +     * escaped appropriately. In HTML URIs are escaped differently
  +     * than normal attributes.
  +     *
  +     * @param tagName The element's tag name
  +     * @param attrName The attribute's name
  +     */
  +    public static boolean isURI( String tagName, String attrName )
  +    {
  +     // Stupid checks.
  +     return ( attrName.equalsIgnoreCase( "href" ) || 
attrName.equalsIgnoreCase( "src" ) );
  +    }
  +
           
       /**
        * Returns the value of an HTML character reference by its name. If the
  @@ -535,7 +550,7 @@
        defineElement( "DT", OPT_CLOSING | ONLY_OPENING | CLOSE_DD_DT );
        defineElement( "FIELDSET", CLOSE_P );
        defineElement( "FORM", CLOSE_P );
  -     defineElement( "FRAME", OPT_CLOSING );
  +     defineElement( "FRAME", EMPTY | OPT_CLOSING );
        defineElement( "H1", CLOSE_P );
        defineElement( "H2", CLOSE_P );
        defineElement( "H3", CLOSE_P );
  
  
  

Reply via email to