stylesheet = new Stylesheet(); stylesheet.setSimplified(); stylesheet.addElement(element); stylesheet.setAttributes((AttributeList) element.getAttributes()); stylesheet.setParser(this); return stylesheet;
_className = getXSLTC().getClassName(); null, this); addDOMField(classGen); compileTransform(classGen); final Enumeration elements = elements(); while (elements.hasMoreElements()) { Object element = elements.nextElement(); getMode(template.getModeName()).addTemplate(template); checkOutputMethod(); processModes(); compileModes(classGen); compileStaticInitializer(classGen); compileConstructor(classGen, _lastOutputElement); if (!getParser().errorsFound()) { getXSLTC().dumpClass(classGen.getJavaClass());
public void setIncludingStylesheet(Stylesheet parent) { _includedFrom = parent; parent.addIncludedStylesheet(this); }
if (context.checkForLoop(docToLoad)) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CIRCULAR_INCLUDE_ERR, docToLoad, this); String currLoadedDoc = context.getSystemId(); SourceLoader loader = context.getSourceLoader(); _included.setSourceLoader(loader); _included.setSystemId(docToLoad); _included.setParentStylesheet(context); _included.setIncludingStylesheet(context); _included.setTemplateInlining(context.getTemplateInlining()); final int precedence = context.getImportPrecedence(); _included.setImportPrecedence(precedence); parser.setCurrentStylesheet(_included); _included.parseContents(parser); final Enumeration elements = _included.elements(); final Stylesheet topStylesheet = parser.getTopLevelStylesheet(); while (elements.hasMoreElements()) { if (element instanceof TopLevelElement) { if (element instanceof Variable) { topStylesheet.addVariable((Variable) element); topStylesheet.addParam((Param) element); topStylesheet.addElement((TopLevelElement) element);
null, this); addDOMField(classGen); compileTransform(classGen); getMode(template.getModeName()).addTemplate(template); checkOutputMethod(); processModes(); compileModes(classGen); compileStaticInitializer(classGen); compileConstructor(classGen, _lastOutputElement);
stylesheet = new Stylesheet(); stylesheet.setSimplified(); stylesheet.addElement(element); stylesheet.setAttributes((AttributeList) element.getAttributes()); stylesheet.setParser(this); return stylesheet;
addPrefixMapping("xml", "http://www.w3.org/XML/1998/namespace"); parseOwnChildren(parser);
addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMES_ARRAY_FIELD); addStaticField(classGen, "[" + STRING_SIG, STATIC_URIS_ARRAY_FIELD); addStaticField(classGen, "[I", STATIC_TYPES_ARRAY_FIELD); addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMESPACE_ARRAY_FIELD); final int charDataFieldCount = getXSLTC().getCharacterDataCount(); for (int i = 0; i < charDataFieldCount; i++) { addStaticField(classGen, STATIC_CHAR_DATA_FIELD_SIG, STATIC_CHAR_DATA_FIELD+i); final Vector namesIndex = getXSLTC().getNamesIndex(); int size = namesIndex.size(); String[] namesArray = new String[size]; final Vector namespaces = getXSLTC().getNamespaceIndex(); staticConst.markChunkStart(); il.append(new PUSH(cpg, namespaces.size())); final Vector namespaceAncestors = getXSLTC().getNSAncestorPointers(); if (namespaceAncestors != null && namespaceAncestors.size() != 0) { addStaticField(classGen, NS_ANCESTORS_INDEX_SIG, STATIC_NS_ANCESTORS_ARRAY_FIELD); staticConst.markChunkStart(); final Vector prefixURIPairsIdx = getXSLTC().getPrefixURIPairsIdx(); if (prefixURIPairsIdx != null && prefixURIPairsIdx.size() != 0) { addStaticField(classGen, PREFIX_URIS_IDX_SIG, STATIC_PREFIX_URIS_IDX_ARRAY_FIELD); staticConst.markChunkStart();
public boolean checkForLoop(String systemId) { // Return true if this stylesheet includes/imports itself if (_systemId != null && _systemId.equals(systemId)) { return true; } // Then check with any stylesheets that included/imported this one if (_parentStylesheet != null) return _parentStylesheet.checkForLoop(systemId); // Otherwise OK return false; }
((Stylesheet)parent).addVariable(this); parser.getSymbolTable().addVariable(this);
((Stylesheet)parent).addParam(this); parser.getSymbolTable().addParam(this);
((Stylesheet)_parent).addTemplate(this);
il.append(new PUSH(cpg, RTF_INITIAL_SIZE)); il.append(new PUSH(cpg, rtfType)); il.append(new PUSH(cpg, stylesheet.callsNodeset())); il.append(new INVOKEINTERFACE(index,4)); if (stylesheet.callsNodeset() && !DOM_CLASS.equals(DOM_IMPL_CLASS)) { if (!stylesheet.callsNodeset()) { il.append(new ICONST(0)); il.append(new ANEWARRAY(cpg.addClass(STRING)));
_className, il, cpg); addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMES_ARRAY_FIELD); addStaticField(classGen, "[" + STRING_SIG, STATIC_URIS_ARRAY_FIELD); addStaticField(classGen, "[I", STATIC_TYPES_ARRAY_FIELD); addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMESPACE_ARRAY_FIELD); addStaticField(classGen, STATIC_CHAR_DATA_FIELD_SIG, STATIC_CHAR_DATA_FIELD+i); addStaticField(classGen, NS_ANCESTORS_INDEX_SIG, STATIC_NS_ANCESTORS_ARRAY_FIELD); staticConst.markChunkStart(); addStaticField(classGen, PREFIX_URIS_IDX_SIG, STATIC_PREFIX_URIS_IDX_ARRAY_FIELD); staticConst.markChunkStart(); addStaticField(classGen, PREFIX_URIS_ARRAY_SIG, STATIC_PREFIX_URIS_ARRAY_FIELD);
if (context.checkForLoop(docToLoad)) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CIRCULAR_INCLUDE_ERR, docToLoad, this); String currLoadedDoc = context.getSystemId(); SourceLoader loader = context.getSourceLoader(); _imported.setSourceLoader(loader); _imported.setSystemId(docToLoad); _imported.setParentStylesheet(context); _imported.setImportingStylesheet(context); _imported.setTemplateInlining(context.getTemplateInlining()); _imported.setImportPrecedence(currPrecedence); context.setImportPrecedence(nextPrecedence); parser.setCurrentStylesheet(_imported); _imported.parseContents(parser); final Enumeration elements = _imported.elements(); final Stylesheet topStylesheet = parser.getTopLevelStylesheet(); while (elements.hasMoreElements()) { if (element instanceof TopLevelElement) { if (element instanceof Variable) { topStylesheet.addVariable((Variable) element); topStylesheet.addParam((Param) element); topStylesheet.addElement((TopLevelElement) element);
null, this); addDOMField(classGen); compileTransform(classGen); getMode(template.getModeName()).addTemplate(template); checkOutputMethod(); processModes(); compileModes(classGen); compileStaticInitializer(classGen); compileConstructor(classGen, _lastOutputElement);
stylesheet = new Stylesheet(); stylesheet.setSimplified(); stylesheet.addElement(element); stylesheet.setAttributes((AttributeList) element.getAttributes()); stylesheet.setParser(this); return stylesheet;
addPrefixMapping("xml", "http://www.w3.org/XML/1998/namespace"); parseOwnChildren(parser);
addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMES_ARRAY_FIELD); addStaticField(classGen, "[" + STRING_SIG, STATIC_URIS_ARRAY_FIELD); addStaticField(classGen, "[I", STATIC_TYPES_ARRAY_FIELD); addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMESPACE_ARRAY_FIELD); final int charDataFieldCount = getXSLTC().getCharacterDataCount(); for (int i = 0; i < charDataFieldCount; i++) { addStaticField(classGen, STATIC_CHAR_DATA_FIELD_SIG, STATIC_CHAR_DATA_FIELD+i); final Vector namesIndex = getXSLTC().getNamesIndex(); int size = namesIndex.size(); String[] namesArray = new String[size]; final Vector namespaces = getXSLTC().getNamespaceIndex(); staticConst.markChunkStart(); il.append(new PUSH(cpg, namespaces.size())); final Vector namespaceAncestors = getXSLTC().getNSAncestorPointers(); if (namespaceAncestors != null && namespaceAncestors.size() != 0) { addStaticField(classGen, NS_ANCESTORS_INDEX_SIG, STATIC_NS_ANCESTORS_ARRAY_FIELD); staticConst.markChunkStart(); final Vector prefixURIPairsIdx = getXSLTC().getPrefixURIPairsIdx(); if (prefixURIPairsIdx != null && prefixURIPairsIdx.size() != 0) { addStaticField(classGen, PREFIX_URIS_IDX_SIG, STATIC_PREFIX_URIS_IDX_ARRAY_FIELD); staticConst.markChunkStart();
public boolean checkForLoop(String systemId) { // Return true if this stylesheet includes/imports itself if (_systemId != null && _systemId.equals(systemId)) { return true; } // Then check with any stylesheets that included/imported this one if (_parentStylesheet != null) return _parentStylesheet.checkForLoop(systemId); // Otherwise OK return false; }