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(com.sun.org.apache.xerces.internal.xni.XMLString text, com.sun.org.apache.xerces.internal.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(com.sun.org.apache.xerces.internal.xni.XMLString text, com.sun.org.apache.xerces.internal.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, com.sun.org.apache.xerces.internal.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(com.sun.org.apache.xerces.internal.xni.QName element, com.sun.org.apache.xerces.internal.xni.XMLAttributes attributes, com.sun.org.apache.xerces.internal.xni.Augmentations augs)
startElement(element, attributes, augs);
endElement(element, augs);
|
public void | endCDATA(com.sun.org.apache.xerces.internal.xni.Augmentations augs)
|
public void | endDocument(com.sun.org.apache.xerces.internal.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(com.sun.org.apache.xerces.internal.xni.QName element, com.sun.org.apache.xerces.internal.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, com.sun.org.apache.xerces.internal.xni.Augmentations augs)
|
public com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource | getDocumentSource()
return null;
|
public void | ignorableWhitespace(com.sun.org.apache.xerces.internal.xni.XMLString text, com.sun.org.apache.xerces.internal.xni.Augmentations augs)
characters(text, augs);
|
public void | processingInstruction(java.lang.String target, com.sun.org.apache.xerces.internal.xni.XMLString data, com.sun.org.apache.xerces.internal.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(com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource source)
|
public void | setIgnoringCharacters(boolean ignore)
fIgnoreChars = ignore;
|
public void | startCDATA(com.sun.org.apache.xerces.internal.xni.Augmentations augs)
|
public void | startDocument(com.sun.org.apache.xerces.internal.xni.XMLLocator locator, java.lang.String encoding, com.sun.org.apache.xerces.internal.xni.NamespaceContext namespaceContext, com.sun.org.apache.xerces.internal.xni.Augmentations augs)
|
public void | startElement(com.sun.org.apache.xerces.internal.xni.QName element, com.sun.org.apache.xerces.internal.xni.XMLAttributes attributes, com.sun.org.apache.xerces.internal.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));
// 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));
elem.setAttributeNode(attr);
}
}
append(elem);
fCurrentNode = elem;
if (fFragmentRoot == null) {
fFragmentRoot = elem;
}
|
public void | startGeneralEntity(java.lang.String name, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier identifier, java.lang.String encoding, com.sun.org.apache.xerces.internal.xni.Augmentations augs)
|
public void | textDecl(java.lang.String version, java.lang.String encoding, com.sun.org.apache.xerces.internal.xni.Augmentations augs)
|
public void | xmlDecl(java.lang.String version, java.lang.String encoding, java.lang.String standalone, com.sun.org.apache.xerces.internal.xni.Augmentations augs)
|