/** * Displays the contents of the element */ public void display(int indent) { indent(indent); Util.println("Element " + _name); displayContents(indent + IndentIncrement); }
/** * Override this method to make sure that xsl:attributes are not * copied to output if this xsl:element is to be ignored */ public void translateContents(ClassGenerator classGen, MethodGenerator methodGen) { final int n = elementCount(); for (int i = 0; i < n; i++) { final SyntaxTreeNode item = (SyntaxTreeNode)getContents().elementAt(i); if (_ignore && item instanceof XslAttribute) continue; item.translate(classGen, methodGen); } }
String name = getAttribute("name"); if (name == EMPTYSTRING) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR, name, this); parser.reportError(WARNING, msg); parseChildren(parser); _ignore = true; // Ignore the element if the QName is invalid return; String namespace = getAttribute("namespace"); name, this); parser.reportError(WARNING, msg); parseChildren(parser); _ignore = true; // Ignore the element if the QName is invalid return; if (!hasAttribute("namespace")) { namespace = lookupNamespace(prefix); if (namespace == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.NAMESPACE_UNDEF_ERR, prefix, this); parser.reportError(WARNING, err); parseChildren(parser); _ignore = true; // Ignore the element if prefix is undeclared return; if (prefix == EMPTYSTRING) { if (Util.isLiteral(namespace)) {
translateLiteral(classGen, methodGen); return; String transletClassName = getXSLTC().getClassName(); il.append(DUP); il.append(new PUSH(cpg, getNodeIDForStylesheetNSLookup())); il.append(new GETSTATIC(cpg.addFieldref( transletClassName, translateContents(classGen, methodGen);
translateLiteral(classGen, methodGen); return; translateContents(classGen, methodGen);
/** * This method is called when the name of the element is known at compile time. * In this case, there is no need to inspect the element name at runtime to * determine if a prefix exists, needs to be generated, etc. */ public void translateLiteral(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); if (!_ignore) { il.append(methodGen.loadHandler()); _name.translate(classGen, methodGen); il.append(DUP2); il.append(methodGen.startElement()); if (_namespace != null) { il.append(methodGen.loadHandler()); il.append(new PUSH(cpg, _prefix)); _namespace.translate(classGen,methodGen); il.append(methodGen.namespace()); } } translateContents(classGen, methodGen); if (!_ignore) { il.append(methodGen.endElement()); } }
&& ((XslElement) _parent).declaresDefaultNS())
translateLiteral(classGen, methodGen); return; String transletClassName = getXSLTC().getClassName(); il.append(DUP); il.append(new PUSH(cpg, getNodeIDForStylesheetNSLookup())); il.append(new GETSTATIC(cpg.addFieldref( transletClassName, translateContents(classGen, methodGen);
translateLiteral(classGen, methodGen); return; translateContents(classGen, methodGen);
/** * This method is called when the name of the element is known at compile time. * In this case, there is no need to inspect the element name at runtime to * determine if a prefix exists, needs to be generated, etc. */ public void translateLiteral(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); if (!_ignore) { il.append(methodGen.loadHandler()); _name.translate(classGen, methodGen); il.append(DUP2); il.append(methodGen.startElement()); if (_namespace != null) { il.append(methodGen.loadHandler()); il.append(new PUSH(cpg, _prefix)); _namespace.translate(classGen,methodGen); il.append(methodGen.namespace()); } } translateContents(classGen, methodGen); if (!_ignore) { il.append(methodGen.endElement()); } }
&& ((XslElement) _parent).declaresDefaultNS())
String name = getAttribute("name"); if (name == EMPTYSTRING) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR, name, this); parser.reportError(WARNING, msg); parseChildren(parser); _ignore = true; // Ignore the element if the QName is invalid return; String namespace = getAttribute("namespace"); name, this); parser.reportError(WARNING, msg); parseChildren(parser); _ignore = true; // Ignore the element if the QName is invalid return; if (!hasAttribute("namespace")) { namespace = lookupNamespace(prefix); if (namespace == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.NAMESPACE_UNDEF_ERR, prefix, this); parser.reportError(WARNING, err); parseChildren(parser); _ignore = true; // Ignore the element if prefix is undeclared return; if (prefix == EMPTYSTRING) { if (Util.isLiteral(namespace)) {
/** * This method is called when the name of the element is known at compile time. * In this case, there is no need to inspect the element name at runtime to * determine if a prefix exists, needs to be generated, etc. */ public void translateLiteral(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); if (!_ignore) { il.append(methodGen.loadHandler()); _name.translate(classGen, methodGen); il.append(DUP2); il.append(methodGen.startElement()); if (_namespace != null) { il.append(methodGen.loadHandler()); il.append(new PUSH(cpg, _prefix)); _namespace.translate(classGen,methodGen); il.append(methodGen.namespace()); } } translateContents(classGen, methodGen); if (!_ignore) { il.append(methodGen.endElement()); } }
&& ((XslElement) _parent).declaresDefaultNS())
/** * Displays the contents of the element */ public void display(int indent) { indent(indent); Util.println("Element " + _name); displayContents(indent + IndentIncrement); }
/** * Override this method to make sure that xsl:attributes are not * copied to output if this xsl:element is to be ignored */ public void translateContents(ClassGenerator classGen, MethodGenerator methodGen) { final int n = elementCount(); for (int i = 0; i < n; i++) { final SyntaxTreeNode item = (SyntaxTreeNode)getContents().elementAt(i); if (_ignore && item instanceof XslAttribute) continue; item.translate(classGen, methodGen); } }
/** * This method is called when the name of the element is known at compile time. * In this case, there is no need to inspect the element name at runtime to * determine if a prefix exists, needs to be generated, etc. */ public void translateLiteral(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); if (!_ignore) { il.append(methodGen.loadHandler()); _name.translate(classGen, methodGen); il.append(DUP2); il.append(methodGen.startElement()); if (_namespace != null) { il.append(methodGen.loadHandler()); il.append(new PUSH(cpg, _prefix)); _namespace.translate(classGen,methodGen); il.append(methodGen.namespace()); } } translateContents(classGen, methodGen); if (!_ignore) { il.append(methodGen.endElement()); } }
&& ((XslElement) _parent).declaresDefaultNS())