use of org.apache.xalan.templates.Stylesheet in project j2objc by google.
the class ProcessorStylesheetElement method startElement.
/**
* Receive notification of the start of an strip-space element.
*
* @param handler The calling StylesheetHandler/TemplatesBuilder.
* @param uri The Namespace URI, or the empty string if the
* element has no Namespace URI or if Namespace
* processing is not being performed.
* @param localName The local name (without prefix), or the
* empty string if Namespace processing is not being
* performed.
* @param rawName The raw XML 1.0 name (with prefix), or the
* empty string if raw names are not available.
* @param attributes The attributes attached to the element. If
* there are no attributes, it shall be an empty
* Attributes object.
*/
public void startElement(StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException {
super.startElement(handler, uri, localName, rawName, attributes);
try {
int stylesheetType = handler.getStylesheetType();
Stylesheet stylesheet;
if (stylesheetType == StylesheetHandler.STYPE_ROOT) {
try {
stylesheet = getStylesheetRoot(handler);
} catch (TransformerConfigurationException tfe) {
throw new TransformerException(tfe);
}
} else {
Stylesheet parent = handler.getStylesheet();
if (stylesheetType == StylesheetHandler.STYPE_IMPORT) {
StylesheetComposed sc = new StylesheetComposed(parent);
parent.setImport(sc);
stylesheet = sc;
} else {
stylesheet = new Stylesheet(parent);
parent.setInclude(stylesheet);
}
}
stylesheet.setDOMBackPointer(handler.getOriginatingNode());
stylesheet.setLocaterInfo(handler.getLocator());
stylesheet.setPrefixes(handler.getNamespaceSupport());
handler.pushStylesheet(stylesheet);
setPropertiesFromAttributes(handler, rawName, attributes, handler.getStylesheet());
handler.pushElemTemplateElement(handler.getStylesheet());
} catch (TransformerException te) {
throw new org.xml.sax.SAXException(te);
}
}
use of org.apache.xalan.templates.Stylesheet in project j2objc by google.
the class ProcessorPreserveSpace method startElement.
/**
* Receive notification of the start of an preserve-space element.
*
* @param handler The calling StylesheetHandler/TemplatesBuilder.
* @param uri The Namespace URI, or the empty string if the
* element has no Namespace URI or if Namespace
* processing is not being performed.
* @param localName The local name (without prefix), or the
* empty string if Namespace processing is not being
* performed.
* @param rawName The raw XML 1.0 name (with prefix), or the
* empty string if raw names are not available.
* @param attributes The attributes attached to the element. If
* there are no attributes, it shall be an empty
* Attributes object.
*/
public void startElement(StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException {
Stylesheet thisSheet = handler.getStylesheet();
WhitespaceInfoPaths paths = new WhitespaceInfoPaths(thisSheet);
setPropertiesFromAttributes(handler, rawName, attributes, paths);
Vector xpaths = paths.getElements();
for (int i = 0; i < xpaths.size(); i++) {
WhiteSpaceInfo wsi = new WhiteSpaceInfo((XPath) xpaths.elementAt(i), false, thisSheet);
wsi.setUid(handler.nextUid());
thisSheet.setPreserveSpaces(wsi);
}
paths.clearElements();
}
Aggregations