1 50 51 package com.lowagie.text.html; 52 53 import java.util.Properties ; 54 55 import org.xml.sax.Attributes ; 56 57 import com.lowagie.text.ElementTags; 58 import com.lowagie.text.xml.XmlPeer; 59 60 63 64 public class HtmlPeer extends XmlPeer { 65 66 74 75 public HtmlPeer(String name, String alias) { 76 super(name, alias.toLowerCase()); 77 } 78 79 87 88 public void addAlias(String name, String alias) { 89 attributeAliases.put(alias.toLowerCase(), name); 90 } 91 92 95 public Properties getAttributes(Attributes attrs) { 96 Properties attributes = new Properties (); 97 attributes.putAll(attributeValues); 98 if (defaultContent != null) { 99 attributes.put(ElementTags.ITEXT, defaultContent); 100 } 101 if (attrs != null) { 102 String attribute, value; 103 for (int i = 0; i < attrs.getLength(); i++) { 104 attribute = getName(attrs.getQName(i).toLowerCase()); 105 value = attrs.getValue(i); 106 attributes.setProperty(attribute, value); 107 } 108 } 109 return attributes; 110 } 111 } 112 113 | Popular Tags |