use of org.apache.xalan.templates.ElemTemplateElement in project robovm by robovm.
the class ProcessorOutputElem method startElement.
/**
* Receive notification of the start of an xsl:output 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.
*
* @throws org.xml.sax.SAXException
*/
public void startElement(StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException {
// Hmmm... for the moment I don't think I'll have default properties set for this. -sb
m_outputProperties = new OutputProperties();
m_outputProperties.setDOMBackPointer(handler.getOriginatingNode());
m_outputProperties.setLocaterInfo(handler.getLocator());
m_outputProperties.setUid(handler.nextUid());
setPropertiesFromAttributes(handler, rawName, attributes, this);
// Access this only from the Hashtable level... we don't want to
// get default properties.
String entitiesFileName = (String) m_outputProperties.getProperties().get(OutputPropertiesFactory.S_KEY_ENTITIES);
if (null != entitiesFileName) {
try {
String absURL = SystemIDResolver.getAbsoluteURI(entitiesFileName, handler.getBaseIdentifier());
m_outputProperties.getProperties().put(OutputPropertiesFactory.S_KEY_ENTITIES, absURL);
} catch (TransformerException te) {
handler.error(te.getMessage(), te);
}
}
handler.getStylesheet().setOutput(m_outputProperties);
ElemTemplateElement parent = handler.getElemTemplateElement();
parent.appendChild(m_outputProperties);
m_outputProperties = null;
}
use of org.apache.xalan.templates.ElemTemplateElement in project robovm by robovm.
the class ProcessorTemplateElem method appendAndPush.
/**
* Append the current template element to the current
* template element, and then push it onto the current template
* element stack.
*
* @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
* @param elem non-null reference to a the current template element.
*
* @throws org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
*/
protected void appendAndPush(StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException {
ElemTemplateElement parent = handler.getElemTemplateElement();
if (// defensive, for better multiple error reporting. -sb
null != parent) {
parent.appendChild(elem);
handler.pushElemTemplateElement(elem);
}
}
use of org.apache.xalan.templates.ElemTemplateElement in project robovm by robovm.
the class StylesheetHandler method getElemVersion.
private double getElemVersion() {
ElemTemplateElement elem = getElemTemplateElement();
double version = -1;
while ((version == -1 || version == Constants.XSLTVERSUPPORTED) && elem != null) {
try {
version = Double.valueOf(elem.getXmlVersion()).doubleValue();
} catch (Exception ex) {
version = -1;
}
elem = elem.getParentElem();
}
return (version == -1) ? Constants.XSLTVERSUPPORTED : version;
}
use of org.apache.xalan.templates.ElemTemplateElement in project robovm by robovm.
the class ProcessorExsltFunction method ancestorIsOk.
/**
* Verify that a literal result belongs to a result element, a variable,
* or a parameter.
*/
boolean ancestorIsOk(ElemTemplateElement child) {
while (child.getParentElem() != null && !(child.getParentElem() instanceof ElemExsltFunction)) {
ElemTemplateElement parent = child.getParentElem();
if (parent instanceof ElemExsltFuncResult || parent instanceof ElemVariable || parent instanceof ElemParam || parent instanceof ElemMessage)
return true;
child = parent;
}
return false;
}
use of org.apache.xalan.templates.ElemTemplateElement in project robovm by robovm.
the class ProcessorExsltFunction method endElement.
/**
* End an ElemExsltFunction, and verify its validity.
*/
public void endElement(StylesheetHandler handler, String uri, String localName, String rawName) throws SAXException {
ElemTemplateElement function = handler.getElemTemplateElement();
// may throw exception
validate(function, handler);
super.endElement(handler, uri, localName, rawName);
}
Aggregations