Methods Summary |
---|
private void | append(org.w3c.dom.Node node)
if (fCurrentNode != null) {
fCurrentNode.appendChild(node);
}
else {
/** Check if this node can be attached to the target. */
if ((kidOK[fTarget.getNodeType()] & (1 << node.getNodeType())) == 0) {
String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
throw new XNIException(msg);
}
fTargetChildren.add(node);
}
|
public void | cdata(org.w3c.dom.CDATASection node)
/** Create new CDATASection node for the target. */
append(fDocument.createCDATASection(node.getNodeValue()));
|
public void | characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
if (!fIgnoreChars) {
append(fDocument.createTextNode(text.toString()));
}
|
public void | characters(org.w3c.dom.Text node)
/** Create new Text node for the target. */
append(fDocument.createTextNode(node.getNodeValue()));
|
public void | comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
|
public void | comment(org.w3c.dom.Comment node)
/** Create new Comment node for the target. */
append(fDocument.createComment(node.getNodeValue()));
|
public void | doctypeDecl(java.lang.String rootElement, java.lang.String publicId, java.lang.String systemId, org.apache.xerces.xni.Augmentations augs)
|
public void | doctypeDecl(org.w3c.dom.DocumentType node)
/** Create new DocumentType node for the target. */
if (fDocumentImpl != null) {
DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId());
final String internalSubset = node.getInternalSubset();
/** Copy internal subset. */
if (internalSubset != null) {
((DocumentTypeImpl) docType).setInternalSubset(internalSubset);
}
/** Copy entities. */
NamedNodeMap oldMap = node.getEntities();
NamedNodeMap newMap = docType.getEntities();
int length = oldMap.getLength();
for (int i = 0; i < length; ++i) {
Entity oldEntity = (Entity) oldMap.item(i);
EntityImpl newEntity = (EntityImpl) fDocumentImpl.createEntity(oldEntity.getNodeName());
newEntity.setPublicId(oldEntity.getPublicId());
newEntity.setSystemId(oldEntity.getSystemId());
newEntity.setNotationName(oldEntity.getNotationName());
newMap.setNamedItem(newEntity);
}
/** Copy notations. */
oldMap = node.getNotations();
newMap = docType.getNotations();
length = oldMap.getLength();
for (int i = 0; i < length; ++i) {
Notation oldNotation = (Notation) oldMap.item(i);
NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName());
newNotation.setPublicId(oldNotation.getPublicId());
newNotation.setSystemId(oldNotation.getSystemId());
newMap.setNamedItem(newNotation);
}
append(docType);
}
|
public void | emptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)
startElement(element, attributes, augs);
endElement(element, augs);
|
public void | endCDATA(org.apache.xerces.xni.Augmentations augs)
|
public void | endDocument(org.apache.xerces.xni.Augmentations augs)
final int length = fTargetChildren.size();
if (fNextSibling == null) {
for (int i = 0; i < length; ++i) {
fTarget.appendChild((Node) fTargetChildren.get(i));
}
}
else {
for (int i = 0; i < length; ++i) {
fTarget.insertBefore((Node) fTargetChildren.get(i), fNextSibling);
}
}
|
public void | endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs)
// write type information to this element
if (augs != null && fDocumentImpl != null) {
ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elementPSVI != null) {
if (fStorePSVI) {
((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
}
XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
if (type == null) {
type = elementPSVI.getTypeDefinition();
}
((ElementNSImpl)fCurrentNode).setType(type);
}
}
// adjust current node reference
if (fCurrentNode == fFragmentRoot) {
fCurrentNode = null;
fFragmentRoot = null;
return;
}
fCurrentNode = fCurrentNode.getParentNode();
|
public void | endGeneralEntity(java.lang.String name, org.apache.xerces.xni.Augmentations augs)
|
public org.apache.xerces.xni.parser.XMLDocumentSource | getDocumentSource()
return null;
|
public void | ignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
characters(text, augs);
|
public void | processingInstruction(java.lang.String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs)
|
public void | processingInstruction(org.w3c.dom.ProcessingInstruction node)
/** Create new ProcessingInstruction node for the target. */
append(fDocument.createProcessingInstruction(node.getTarget(), node.getData()));
|
public void | setDOMResult(javax.xml.transform.dom.DOMResult result)
fCurrentNode = null;
fFragmentRoot = null;
fIgnoreChars = false;
fTargetChildren.clear();
if (result != null) {
fTarget = result.getNode();
fNextSibling = result.getNextSibling();
fDocument = (fTarget.getNodeType() == Node.DOCUMENT_NODE) ? (Document) fTarget : fTarget.getOwnerDocument();
fDocumentImpl = (fDocument instanceof CoreDocumentImpl) ? (CoreDocumentImpl) fDocument : null;
fStorePSVI = (fDocument instanceof PSVIDocumentImpl);
return;
}
fTarget = null;
fNextSibling = null;
fDocument = null;
fDocumentImpl = null;
fStorePSVI = false;
|
public void | setDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source)
|
public void | setIgnoringCharacters(boolean ignore)
fIgnoreChars = ignore;
|
public void | startCDATA(org.apache.xerces.xni.Augmentations augs)
|
public void | startDocument(org.apache.xerces.xni.XMLLocator locator, java.lang.String encoding, org.apache.xerces.xni.NamespaceContext namespaceContext, org.apache.xerces.xni.Augmentations augs)
|
public void | startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)
Element elem;
int attrCount = attributes.getLength();
if (fDocumentImpl == null) {
elem = fDocument.createElementNS(element.uri, element.rawname);
for (int i = 0; i < attrCount; ++i) {
attributes.getName(i, fAttributeQName);
elem.setAttributeNS(fAttributeQName.uri, fAttributeQName.rawname, attributes.getValue(i));
}
}
// If it's a Xerces DOM store type information for attributes, set idness, etc..
else {
elem = fDocumentImpl.createElementNS(element.uri, element.rawname, element.localpart);
for (int i = 0; i < attrCount; ++i) {
attributes.getName(i, fAttributeQName);
AttrImpl attr = (AttrImpl) fDocumentImpl.createAttributeNS(fAttributeQName.uri,
fAttributeQName.rawname, fAttributeQName.localpart);
attr.setValue(attributes.getValue(i));
elem.setAttributeNodeNS(attr);
// write type information to this attribute
AttributePSVI attrPSVI = (AttributePSVI) attributes.getAugmentations(i).getItem (Constants.ATTRIBUTE_PSVI);
if (attrPSVI != null) {
if (fStorePSVI) {
((PSVIAttrNSImpl) attr).setPSVI(attrPSVI);
}
Object type = attrPSVI.getMemberTypeDefinition();
if (type == null) {
type = attrPSVI.getTypeDefinition();
if (type != null) {
attr.setType (type);
if (((XSSimpleType) type).isIDType()) {
((ElementImpl) elem).setIdAttributeNode (attr, true);
}
}
}
else {
attr.setType (type);
if (((XSSimpleType) type).isIDType()) {
((ElementImpl) elem).setIdAttributeNode (attr, true);
}
}
}
attr.setSpecified(attributes.isSpecified(i));
}
}
append(elem);
fCurrentNode = elem;
if (fFragmentRoot == null) {
fFragmentRoot = elem;
}
|
public void | startGeneralEntity(java.lang.String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, java.lang.String encoding, org.apache.xerces.xni.Augmentations augs)
|
public void | textDecl(java.lang.String version, java.lang.String encoding, org.apache.xerces.xni.Augmentations augs)
|
public void | xmlDecl(java.lang.String version, java.lang.String encoding, java.lang.String standalone, org.apache.xerces.xni.Augmentations augs)
|