1 package net.sf.saxon.event; 2 3 import net.sf.saxon.om.NamePool; 4 import net.sf.saxon.om.NamespaceConstant; 5 6 import java.util.HashSet ; 7 8 9 18 19 20 public class XHTMLIndenter extends HTMLIndenter { 21 22 private HashSet inlineTagSet; 23 private HashSet formattedTagSet; 24 25 26 protected int classifyTag(int nameCode) { 27 if (inlineTagSet == null) { 28 NamePool pool = getNamePool(); 29 inlineTagSet = new HashSet (40); 30 formattedTagSet = new HashSet (10); 31 for (int i=0; i<inlineTags.length; i++) { 32 int nc = pool.allocate("", NamespaceConstant.XHTML, inlineTags[i]); 33 inlineTagSet.add(new Integer (nc)); 34 } 35 for (int i=0; i<formattedTags.length; i++) { 36 int nc = pool.allocate("", NamespaceConstant.XHTML, formattedTags[i]); 37 formattedTagSet.add(new Integer (nc)); 38 } 39 } 40 int r = 0; 41 Integer key = new Integer (nameCode & NamePool.FP_MASK); 42 if (inlineTagSet.contains(key)) { 43 r |= IS_INLINE; 44 } 45 if (formattedTagSet.contains(key)) { 46 r |= IS_FORMATTED; 47 } 48 return r; 49 } 50 51 52 public XHTMLIndenter() {} 53 54 55 }; 56 57 75 | Popular Tags |