1 package com.icl.saxon.style; 2 import com.icl.saxon.tree.AttributeCollection; 3 import com.icl.saxon.*; 4 import com.icl.saxon.expr.*; 5 import javax.xml.transform.*; 6 7 import org.w3c.dom.Node ; 8 9 13 14 public class SAXONItem extends StyleElement { 15 16 private SAXONGroup group; 17 18 public void prepareAttributes() throws TransformerConfigurationException { 19 AttributeCollection atts = getAttributeList(); 20 for (int a=0; a<atts.getLength(); a++) { 21 int nc = atts.getNameCode(a); 22 checkUnknownAttribute(nc); 23 } 24 } 25 26 30 31 public boolean mayContainTemplateBody() { 32 return true; 33 } 34 35 public void validate() throws TransformerConfigurationException { 36 checkWithinTemplate(); 37 Node parent = getParentNode(); 38 while (parent!=null) { 39 if (parent instanceof SAXONGroup) { 40 group = (SAXONGroup)parent; 41 break; 42 } 43 parent = parent.getParentNode(); 44 } 45 46 if (group==null) { 47 compileError("saxon:item must be within a saxon:group"); 48 } 49 50 } 51 52 public void process(Context context) throws TransformerException 53 { 54 GroupActivation f = (GroupActivation)context.getGroupActivationStack().peek(); 55 56 while(true) { 57 processChildren(context); 58 if (!f.sameAsNext()) break; 59 f.nextElement(); 60 } 61 } 62 63 } 64 65 | Popular Tags |