/** * Transforms the <code>Access</code> POJO into a DOM element. * * @param document the core DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "access" ); element.setAttribute( "group", this.getGroup() ); // properties ElementImpl properties = new ElementImpl( document, "properties" ); for ( Iterator propertyIterator = this.getProperties().iterator(); propertyIterator.hasNext(); ) { Property property = (Property) propertyIterator.next(); properties.appendChild( property.toDOMElement( document ) ); } element.appendChild( properties ); return element; }
public void endElement(String uri, String localName, String qName) throws SAXException { String tagName = getName(qName, localName); if ( _current == null ) throw new SAXException( "HTM007 State error: endElement called with no current node." ); if ( ! _current.getNodeName().equalsIgnoreCase( tagName )) throw new SAXException( "HTM008 State error: mismatch in closing tag name " + tagName + "\n" + tagName); // Move up to the parent element. When you reach the top (closing the root element). // the parent is document and current is null. if ( _current.getParentNode() == _current.getOwnerDocument() ) _current = null; else _current = (ElementImpl) _current.getParentNode(); }
/** @param namespace the namespace * @param key case-sensitive */ @Override public Attr getAttributeNodeNS( String namespace, String key ) { if(namespace!=null && 0<namespace.length()) return super.getAttributeNodeNS(namespace, key); return super.getAttributeNode(key); }
/** * Transform the <code>JMSTopic</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "jmstopic" ); element.setAttribute( "name", this.getName() ); return element; }
if (ownerDocument.errorChecking && isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( msg); if (needsSyncData()) { synchronizeData(); localName = qualifiedName.substring(index + 1); Attr newAttr = getAttributeNodeNS(namespaceURI, localName); if (newAttr == null) { newAttr = getOwnerDocument().createAttributeNS( namespaceURI, qualifiedName); newAttr = ((CoreDocumentImpl)getOwnerDocument()).createAttributeNS(namespaceURI, qualifiedName, localName); attributes.setNamedItemNS(newAttr);
if (ownerDocument.errorChecking && isReadOnly()) { String msg = DOMMessageFormatter.formatMessage( if (needsSyncData()) { synchronizeData(); Attr newAttr = getAttributeNode(name); if (newAttr == null) { newAttr = getOwnerDocument().createAttribute(name);
/** * Transforms the <code>Journal</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "journal" ); // events for ( Iterator eventIterator = this.getEvents().iterator(); eventIterator.hasNext(); ) { Event event = (Event) eventIterator.next(); element.appendChild( event.toDOMElement( document ) ); } return element; }
uri = element.getNamespaceURI(); prefix = element.getPrefix(); if (uri != null) { // Element has a namespace uri = fSymbolTable.addSymbol(uri); if (element.getLocalName() == null) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NullLocalElementName", new Object[]{element.getNodeName()}); reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_FATAL_ERROR, "NullLocalElementName"); String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NullLocalElementName", new Object[]{element.getNodeName()}); reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR, "NullLocalElementName");
Node parent = el.getParentNode(); Node nextSib = el.getNextSibling(); if (parent != null) { parent.removeChild(el); Node child = el.getFirstChild(); while (child != null) { el.removeChild(child); nel.appendChild(child); child = el.getFirstChild();
if (!enableNS) { if (tagName.equals("*") || ((ElementImpl) current).getTagName().equals(tagName)) ElementImpl el = (ElementImpl) current; if ((nsName == null && el.getNamespaceURI() == null) || (nsName != null && nsName.equals(el.getNamespaceURI()))) if (el.getLocalName() != null && el.getLocalName().equals(tagName)) { if (nsName != null && nsName.equals("*")) { return current; } else { if ((nsName == null && el.getNamespaceURI() == null) || (nsName != null && nsName.equals(el.getNamespaceURI())))
throw new SAXException( "HTM006 State error: startElement called after end of document element." ); elem = (ElementImpl) _document.createElement( tagName ); _current.appendChild( elem ); _current = elem; elem.setAttribute(getName(attrList.getQName(i), attrList.getLocalName(i)), attrList.getValue( i ) );
/** First adopts the new child, then appends it. * * I do this so that we can insert elements that were created with a * different owner document or no owner document, such as from * "new Image()" in javascript. * * @param newChild the new child * @see org.apache.xerces.dom.NodeImpl#appendChild(org.w3c.dom.Node) */ @Override public Node appendChild(Node newChild) throws DOMException { //We don't need adoptChild(newChild) because super.appendChild() calls insertBefore(n,r)? //adoptNode(newChild); return super.appendChild(newChild); }
public MathML element(String name) { CoreDocumentImpl document = (CoreDocumentImpl) document(); return new MathML(new ElementImpl(document, name)); }
/** Always lowercase */ @Override public String getTagName(){ //We can trust that it is lowercase because Decorator.decorate() sets it so. return super.getTagName(); // String tag=super.getTagName(); // return tag.toLowerCase(); }
/** * Introduced in DOM Level 2. */ public boolean hasAttributeNS(String namespaceURI, String localName) { return getAttributeNodeNS(namespaceURI, localName) != null; }
/** * Introduced in DOM Level 2. */ public boolean hasAttribute(String name) { return getAttributeNode(name) != null; }
int index = fElement.getXercesAttribute(qname.uri, qname.localpart); ((CoreDocumentImpl) fElement.getOwnerDocument()).createAttributeNS( qname.uri, qname.rawname, index = fElement.setXercesAttributeNode(attr); fDTDTypes.insertElementAt(attrType, index); fAugmentations.insertElementAt(new AugmentationsImpl(), index);
@Override public HTMLDocument getOwnerDocument(){return (HTMLDocument)super.getOwnerDocument();}
/** Get the default attributes. */ protected NamedNodeMapImpl getDefaultAttributes() { DocumentTypeImpl doctype = (DocumentTypeImpl) ownerDocument.getDoctype(); if (doctype == null) { return null; } ElementDefinitionImpl eldef = (ElementDefinitionImpl)doctype.getElements() .getNamedItem(getNodeName()); if (eldef == null) { return null; } return (NamedNodeMapImpl) eldef.getAttributes(); } // getDefaultAttributes()
/** * Transforms the <code>Cache</code> POJO to a DOM element. * * @param document the core XML document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "cache" ); element.setAttribute( "path", this.getPath() ); return element; }