24 #include <QtXml/QDomAttr>
25 #include <QtCore/QDebug>
27 using namespace KJSEmbed;
77 QDomNode node =
value.firstChild();
103 QDomNode first = KJSEmbed::
extractValue<QDomNode>(exec, args, 0);
104 QDomNode second = KJSEmbed::
extractValue<QDomNode>(exec, args, 1);
105 QDomNode node =
value.insertAfter( first, second );
118 result = KJS::jsBoolean(
value.isCharacterData() );
130 result = KJS::jsBoolean(
value.isDocumentFragment() );
146 result = KJS::jsBoolean(
value.isEntityReference() );
158 result = KJS::jsBoolean(
value.isProcessingInstruction() );
172 QDomNode node =
value.lastChild();
178 QDomElement node =
value.lastChildElement( arg0 );
188 QDomNode node =
value.namedItem( arg0 );
197 QDomNode node =
value.nextSibling();
203 QDomElement node =
value.nextSiblingElement( arg0 );
226 QDomNode node =
value.previousSibling();
232 QDomNode node =
value.previousSiblingElement( arg0 );
237 QDomNode arg0 = KJSEmbed::
extractValue<QDomNode>(exec, args, 0);
238 QDomNode node =
value.removeChild( arg0 );
243 QDomNode arg0 = KJSEmbed::
extractValue<QDomNode>(exec, args, 0);
244 QDomNode arg1 =KJSEmbed::
extractValue<QDomNode>(exec, args, 1);
245 QDomNode node =
value.replaceChild(arg0,arg1);
251 value.setPrefix(arg0);
256 value.setNodeValue(arg0);
271 {
"appendChild", 1, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::appendChild},
272 {
"attributes", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::attributes},
273 {
"childNodes", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::childNodes},
275 {
"cloneNode", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::cloneNode},
276 {
"firstChild", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::firstChild},
277 {
"firstChildElement", 1, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::firstChildElement},
278 {
"hasAttributes", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::hasAttributes},
279 {
"hasChildNodes", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::hasChildNodes},
280 {
"insertBefore", 2, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::insertBefore},
281 {
"insertAfter", 2, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::insertAfter},
282 {
"isAttr", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isAttr},
283 {
"isCDATASection", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isCDATASection},
284 {
"isCharacterData", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isCharacterData},
285 {
"isComment", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isComment},
286 {
"isDocument", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isDocument},
287 {
"isDocumentFragment", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isDocumentFragment},
288 {
"isDocumentType", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isDocumentType},
289 {
"isElement", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isElement},
290 {
"isEntity", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isEntity},
291 {
"isEntityReference", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isEntityReference},
292 {
"isNotation", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isNotation},
293 {
"isNull", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isNull},
294 {
"isProcessingInstruction", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isProcessingInstruction},
295 {
"isSupported", 2, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isSupported},
296 {
"isText", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::isText},
297 {
"lastChild", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::lastChild},
298 {
"lastChildElement", 1, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::lastChildElement},
300 {
"namedItem", 1, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::namedItem},
301 {
"namespaceURI", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::namespaceURI},
302 {
"nextSibling", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::nextSibling},
303 {
"nextSiblingElement", 1, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::nextSiblingElement},
304 {
"nodeType", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::nodeType},
305 {
"nodeName", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::nodeName},
306 {
"nodeValue", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::nodeValue},
308 {
"ownerDocument", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::ownerDocument},
309 {
"parentNode", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::parentNode},
310 {
"prefix", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::prefix},
311 {
"previousSibling", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::previousSibling},
312 {
"previousSiblingElement", 1, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::previousSiblingElement},
313 {
"removeChild", 1, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::removeChild},
314 {
"replaceChild", 2, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::replaceChild},
317 {
"toAttr", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::toAttr},
318 {
"toElement", 0, KJS::DontDelete|KJS::ReadOnly, &DomNodeNS::toElement}
322 {
"ElementNode", QDomNode::ElementNode},
323 {
"AttributeNode", QDomNode::AttributeNode},
324 {
"TextNode", QDomNode::TextNode},
325 {
"CDATASectionNode", QDomNode::CDATASectionNode},
326 {
"EntityReferenceNode", QDomNode::EntityReferenceNode},
327 {
"EntityNode", QDomNode::EntityNode},
328 {
"ProcessingInstructionNode", QDomNode::ProcessingInstructionNode},
329 {
"CommentNode", QDomNode::CommentNode},
330 {
"DocumentNode", QDomNode::DocumentNode},
331 {
"DocumentTypeNode", QDomNode::DocumentTypeNode},
332 {
"DocumentFragmentNode", QDomNode::DocumentFragmentNode},
333 {
"NotationNode", QDomNode::NotationNode},
334 {
"BaseNode", QDomNode::BaseNode},
335 {
"CharacterDataNode", QDomNode::CharacterDataNode}
352 namespace DomDocumentNS
381 QDomElement elem =
value.elementById(
id);
424 QDomElement elem =
value.createElementNS( nsURI, qName );
457 {
"setContent", 1, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::setContent},
458 {
"toString", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::toString},
459 {
"documentElement", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::documentElement},
460 {
"elementById", 1, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::elementById},
461 {
"createAttribute", 1, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createAttribute },
462 {
"createAttributeNS", 2, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createAttributeNS },
463 {
"createCDATASection", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createCDATASection},
464 {
"createComment", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createComment},
465 {
"createDocumentFragment", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createDocumentFragment},
466 {
"createElement", 1, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createElement},
467 {
"createElementNS", 2, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createElementNS},
468 {
"createEntityReference", 1, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createEntityReference},
469 {
"createProcessingInstruction", 2, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createProcessingInstruction},
470 {
"createTextNode", 1, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::createTextNode},
471 {
"importNode", 2, KJS::DontDelete|KJS::ReadOnly, &DomDocumentNS::importNode}
490 namespace DomElementNS {
523 value.removeAttribute( attr );
543 result = KJS::jsBoolean(
value.hasAttributeNS(ns, attr) );
549 value.removeAttributeNS( ns, attr );
561 QDomNodeList nodes =
value.elementsByTagNameNS( ns, name );
574 QDomAttr attr =
value.attributeNodeNS( ns, name );
579 QDomAttr attr = KJSEmbed::
extractValue<QDomAttr>( exec, args, 0);
585 QDomAttr attr = KJSEmbed::
extractValue<QDomAttr>( exec, args, 0);
586 QDomAttr newAttr =
value.setAttributeNode( attr );
591 QDomAttr attr = KJSEmbed::
extractValue<QDomAttr>( exec, args, 0);
592 QDomAttr newAttr =
value.setAttributeNodeNS( attr );
601 {
"toString", 0, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::toString},
602 {
"text", 0, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::toString},
606 {
"attribute", 2, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::attribute},
607 {
"hasAttribute", 1, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::hasAttribute},
610 {
"attributeNS", 3, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::attributeNS},
611 {
"hasAttributeNS", 2, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::hasAttributeNS},
613 {
"elementsByTagName", 1, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::elementsByTagName},
614 {
"elementsByTagNameNS", 2, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::elementsByTagNameNS},
615 {
"attributeNode", 1, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::attributeNode},
616 {
"attributeNodeNS", 2, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::attributeNodeNS},
617 {
"removeAttributeNode", 1, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::removeAttributeNode},
618 {
"setAttributeNode", 1, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::setAttributeNode},
619 {
"setAttributeNodeNS", 1, KJS::DontDelete|KJS::ReadOnly, &DomElementNS::setAttributeNodeNS}
634 namespace AttrElementNS {
640 result = KJS::jsBoolean( value.specified( ) );
664 {
"specified", 0, KJS::DontDelete|KJS::ReadOnly, &AttrElementNS::specified},
665 {
"ownerElement", 0, KJS::DontDelete|KJS::ReadOnly, &AttrElementNS::ownerElement},
681 namespace NodeListNS {
702 {
"count", 0, KJS::DontDelete|KJS::ReadOnly, &NodeListNS::count},
703 {
"length", 0, KJS::DontDelete|KJS::ReadOnly, &NodeListNS::length},
704 {
"item", 1, KJS::DontDelete|KJS::ReadOnly, &NodeListNS::item}
719 namespace DomDocumentTypeNS {
749 {
"entities", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentTypeNS::entities},
750 {
"notations", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentTypeNS::notations},
751 {
"internalSubset", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentTypeNS::internalSubset},
753 {
"publicId", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentTypeNS::publicId},
754 {
"systemId", 0, KJS::DontDelete|KJS::ReadOnly, &DomDocumentTypeNS::systemId}
768 namespace NamedNodeMapNS {
790 QDomNode node =
value.namedItem(name);
803 QDomNode node =
value.removeNamedItem( name );
810 QDomNode node =
value.removeNamedItemNS(nsuri, localName);
821 QDomNode newNode = KJSEmbed::
extractValue<QDomNode>(exec,args,0);
822 QDomNode node =
value.setNamedItemNS(newNode);
832 {
"contains", 0, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::contains},
833 {
"count", 0, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::count},
834 {
"item", 1, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::item},
835 {
"length", 0, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::length},
836 {
"namedItem", 1, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::namedItem},
837 {
"namedItemNS", 2, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::namedItemNS},
838 {
"removeNamedItem", 1, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::removeNamedItem},
839 {
"removeNamedItemNS", 2, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::removeNamedItemNS},
840 {
"setNamedItem", 1, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::setNamedItem},
841 {
"setNamedItemNS", 1, KJS::DontDelete|KJS::ReadOnly, &NamedNodeMapNS::setNamedItemNS}
value removeAttributeNS(ns, attr)
object setValue(key, value)
END_VALUE_METHOD QDomElement elem
END_VALUE_METHOD QString ns
END_VALUE_METHOD QString attr
static void publish(KJS::ExecState *exec, KJS::JSObject *object, const Method *methods)
Publishes an array of Methods to an object.
END_VALUE_METHOD QString newValue
END_VALUE_METHOD QString tagName
QString parserErrorTemplate
bool KJSEMBED_EXPORT extractBool(KJS::ExecState *exec, const KJS::List &args, int idx, bool defaultValue=false)
Extracts a bool from an argument list.
END_VALUE_METHOD QString target
Value binding implementation.
DomAttrBinding(KJS::ExecState *exec, const QDomAttr &value)
int KJSEMBED_EXPORT extractInt(KJS::ExecState *exec, const KJS::List &args, int idx, int defaultValue=0)
Extracts an integer from an argument list.
END_VALUE_METHOD QDomDocument doc
DomNodeListBinding(KJS::ExecState *exec, const QDomNodeList &value)
DomNamedNodeMapBinding(KJS::ExecState *exec, const QDomNamedNodeMap &value)
QDomProcessingInstruction inst
END_VALUE_METHOD QDomNamedNodeMap map
END_QOBJECT_METHOD object clear()
DomDocumentBinding(KJS::ExecState *exec, const QDomDocument &value)
#define START_CTOR(TYPE, JSNAME, ARGS)
END_VALUE_METHOD QDomDocumentFragment fragment
#define END_VALUE_METHOD
End a variant method started by START_VALUE_METHOD.
END_VALUE_METHOD QString commenttxt
END_VALUE_METHOD QDomNode newNode
END_VALUE_METHOD int indent
value removeAttribute(attr)
value setAttributeNS(ns, attr, val)
START_METHOD_LUT(DomNode)
END_VALUE_METHOD value clear()
END_VALUE_METHOD QString nsuri
#define START_VALUE_METHOD(METHODNAME, TYPE)
A simple variant syle method.
END_VALUE_METHOD QDomElement owner
END_VALUE_METHOD QString texttext
END_VALUE_METHOD QDomNode import
END_VALUE_METHOD QDomNode first
KJS::JSCell * jsString(const QString &s)
static const KJS::ClassInfo info
END_VALUE_METHOD QString tag
END_OBJECT_METHOD QPolygon arg0
T extractValue(KJS::ExecState *exec, KJS::JSValue *arg, const T &defaultValue)
Extracts a pointer based type from an ObjectBinding object.
END_VALUE_METHOD value normalize()
DomTextBinding(KJS::ExecState *exec, const QDomText &value)
KJS::JSValue * createValue(KJS::ExecState *exec, const KJS::UString &className, const T &value)
DomNodeBinding(KJS::ExecState *exec, const QDomNode &value)
QString KJSEMBED_EXPORT extractQString(KJS::ExecState *exec, const KJS::List &args, int idx, const QString defaultValue=QString())
Extracts a QString from an argument list.
DomElementBinding(KJS::ExecState *exec, const QDomElement &value)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
JSObject * throwError(ExecState *e, ErrorType t, const QString &m)
END_VALUE_METHOD QString nsURI
#define START_ENUM_LUT(TYPE)
END_VALUE_METHOD QString cdatatxt
DomDocumentTypeBinding(KJS::ExecState *exec, const QDomDocumentType &value)
value setAttribute(tag, newValue)