throws Exception
{
XslNode xslNode = null;
if (child instanceof QElement) {
QElement elt = (QElement) child;
Class cl = _tagMap.get(elt.getQName());
if (cl != null) {
xslNode = (XslNode) cl.newInstance();
xslNode.setGenerator(this);
xslNode.setParent(_xslNode);
xslNode.setStartLocation(((QAbstractNode) child).getBaseURI(),
((QAbstractNode) child).getFilename(),
((QAbstractNode) child).getLine());
QAttr attr = (QAttr) elt.getFirstAttribute();
for (; attr != null; attr = (QAttr) attr.getNextSibling()) {
xslNode.addAttribute(attr.getQName(), attr.getNodeValue());
}
xslNode.endAttributes();
XslNode oldNode = _xslNode;
_xslNode = xslNode;
Node node = elt.getFirstChild();
for (; node != null; node = node.getNextSibling()) {
XslNode xslChild = createChild(node);
if (xslChild != null)
xslNode.addChild(xslChild);
}
xslNode.endElement();
_xslNode = oldNode;
}
/*
else if (elt.getNodeName().equals("jsp:decl") ||
elt.getNodeName().equals("jsp:declaration") ||
elt.getNodeName().startsWith("jsp:directive")) {
}
*/
else if (child.getNodeName().startsWith("xsl:") &&
! XSLNS.equals(child.getNamespaceURI())) {
throw error(child, L.l("<{0}> has an xsl: prefix, but is not in the {1} namespace. XSL requires an xmlns:xsl=\"{1}\" namespace attribute.",
child.getNodeName(),
XSLNS));
}
else if (! XSLNS.equals(child.getNamespaceURI()) &&
! XTPNS.equals(child.getNamespaceURI())) {
xslNode = new XslElementNode(elt.getQName());
xslNode.setGenerator(this);
xslNode.setParent(_xslNode);
xslNode.setStartLocation(((QAbstractNode) child).getBaseURI(),
((QAbstractNode) child).getFilename(),
((QAbstractNode) child).getLine());
QAttr attr = (QAttr) elt.getFirstAttribute();
for (; attr != null; attr = (QAttr) attr.getNextSibling())
xslNode.addAttribute(attr.getQName(), attr.getNodeValue());
xslNode.endAttributes();
XslNode oldNode = _xslNode;
_xslNode = xslNode;
Node node = elt.getFirstChild();
for (; node != null; node = node.getNextSibling()) {
XslNode xslChild = createChild(node);
xslNode.addChild(xslChild);
}