当前位置: 首页>>代码示例>>C++>>正文


C++ NamedNodeMap::getNamedItem方法代码示例

本文整理汇总了C++中NamedNodeMap::getNamedItem方法的典型用法代码示例。如果您正苦于以下问题:C++ NamedNodeMap::getNamedItem方法的具体用法?C++ NamedNodeMap::getNamedItem怎么用?C++ NamedNodeMap::getNamedItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NamedNodeMap的用法示例。


在下文中一共展示了NamedNodeMap::getNamedItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: runTest

   /*
    * Runs the test case.
    */
   void runTest()
   {
      Document doc;
      NodeList acronymList;
      Node testNode;
      NamedNodeMap attributes;
      Attr titleAttr;
      String value;
      Node textNode;
      Node retval;
      Node lastChild;
      Document otherDoc;
      doc = (Document) baseT::load("hc_staff", true);
      otherDoc = (Document) baseT::load("hc_staff", true);
      acronymList = doc.getElementsByTagName(SA::construct_from_utf8("acronym"));
      testNode = acronymList.item(3);
      attributes = testNode.getAttributes();
      titleAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title"));
      textNode = otherDoc.createTextNode(SA::construct_from_utf8("terday"));
      
      {
         boolean success = false;
         try {
            retval = titleAttr.appendChild(textNode);
          } catch (const DOMException& ex) {
            success = (ex.code() == DOMException::WRONG_DOCUMENT_ERR);
         }
         assertTrue(success);
      }

   }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:34,代码来源:hc_attrappendchild5.hpp

示例2: jsNamedNodeMapPrototypeFunctionGetNamedItem

EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionGetNamedItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
        return throwVMTypeError(exec);
    JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue));
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl());
    const String& name(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getNamedItem(name)));
    return JSValue::encode(result);
}
开发者ID:13W,项目名称:phantomjs,代码行数:15,代码来源:JSNamedNodeMap.cpp

示例3: runTest

   /*
    * Runs the test case.
    */
   void runTest()
   {
      Document doc;
      NodeList genderList;
      Node gender;
      NodeList genList;
      Node gen;
      NodeList gList;
      Node g;
      NamedNodeMap attrList;
      Attr attrNode;
      doc = (Document) baseT::load("staff", true);
      genderList = doc.getElementsByTagName(SA::construct_from_utf8("gender"));
      gender = genderList.item(2);
      baseT::assertNotNull(gender, __LINE__, __FILE__);
      genList = gender.getChildNodes();
      gen = genList.item(0);
      baseT::assertNotNull(gen, __LINE__, __FILE__);
      gList = gen.getChildNodes();
      g = gList.item(0);
      baseT::template skipIfNot<EntityReference>(g);
     baseT::assertNotNull(g, __LINE__, __FILE__);
      attrList = g.getAttributes();
      baseT::assertNotNull(attrList, __LINE__, __FILE__);
      attrNode = (Attr) attrList.getNamedItem(SA::construct_from_utf8("domestic"));
      baseT::assertNotNull(attrNode, __LINE__, __FILE__);
      
      {
         boolean success = false;
         try {
            attrNode.setValue(SA::construct_from_utf8("newvalue"));
          } catch (const DOMException& ex) {
            success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR);
         }
         assertTrue(success);
      }

      {
         boolean success = false;
         try {
            attrNode.setNodeValue(SA::construct_from_utf8("newvalue2"));
          } catch (const DOMException& ex) {
            success = (ex.code() == DOMException::NO_MODIFICATION_ALLOWED_ERR);
         }
         assertTrue(success);
      }

   }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:51,代码来源:attrsetvaluenomodificationallowederr.hpp

示例4: runTest

 /*
  * Runs the test case.
  */
 void runTest()
 {
    Document doc;
    NodeList addressList;
    Node testNode;
    NamedNodeMap attributes;
    Attr domesticAttr;
    Node s;
    doc = (Document) baseT::load("staff", false);
    addressList = doc.getElementsByTagName(SA::construct_from_utf8("address"));
    testNode = addressList.item(0);
    attributes = testNode.getAttributes();
    domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic"));
    s = domesticAttr.getPreviousSibling();
    baseT::assertNull(s, __LINE__, __FILE__);
    
 }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:20,代码来源:attrprevioussiblingnull.hpp

示例5: runTest

  /*
   * Runs the test case.
   */
  void runTest()
  {
     Document doc;
     NodeList addressList;
     Node testNode;
     NamedNodeMap attributes;
     Attr domesticAttr;
     String value;
     doc = (Document) baseT::load("hc_staff", false);
     addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym"));
     testNode = addressList.item(0);
     attributes = testNode.getAttributes();
     domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("title"));
     value = domesticAttr.getNodeValue();
     baseT::assertEquals("Yes", value, __LINE__, __FILE__);
 
  }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:20,代码来源:hc_attreffectivevalue.hpp

示例6: runTest

  /*
   * Runs the test case.
   */
  void runTest()
  {
     Document doc;
     NodeList elementList;
     Node testEmployee;
     NamedNodeMap attributes;
     Attr domesticAttr;
     String attrName;
     doc = (Document) baseT::load("staff", false);
     elementList = doc.getElementsByTagName(SA::construct_from_utf8("address"));
     testEmployee = elementList.item(1);
     attributes = testEmployee.getAttributes();
     domesticAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("domestic"));
     attrName = domesticAttr.getNodeName();
     baseT::assertEquals("domestic", attrName, __LINE__, __FILE__);
 
  }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:20,代码来源:namednodemapgetnameditem.hpp

示例7: runTest

    /*
     * Runs the test case.
     */
    void runTest()
    {
        Document doc;
        DocumentType docType;
        NamedNodeMap notations;
        Node notationNode;
        String notationName;
        doc = (Document) baseT::load("staff", false);
        docType = doc.getDoctype();
        baseT::assertNotNull(docType, __LINE__, __FILE__);
        notations = docType.getNotations();
        baseT::assertNotNull(notations, __LINE__, __FILE__);
        notationNode = notations.getNamedItem(SA::construct_from_utf8("notation1"));
        baseT::skipIfNull(notationNode);
        notationName = notationNode.getNodeName();
        baseT::assertEquals("notation1", notationName, __LINE__, __FILE__);

    }
开发者ID:kthguru,项目名称:arabica,代码行数:21,代码来源:nodenotationnodename.hpp

示例8: runTest

   /*
    * Runs the test case.
    */
   void runTest()
   {
      Document doc;
      DocumentType docType;
      NamedNodeMap notations;
      Notation notationNode;
      String systemId;
      doc = (Document) baseT::load("staff", false);
      docType = doc.getDoctype();
      baseT::assertNotNull(docType, __LINE__, __FILE__);
      notations = docType.getNotations();
      baseT::assertNotNull(notations, __LINE__, __FILE__);
      notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation2"));
      baseT::skipIfNull(notationNode);
      systemId = notationNode.getSystemId();
      baseT::assertURIEquals("uriEquals", "", "", "", "notation2File", "", "", "", false, systemId);

   }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:21,代码来源:notationgetsystemid.hpp

示例9: runTest

  /*
   * Runs the test case.
   */
  void runTest()
  {
     Document doc;
     DocumentType docType;
     NamedNodeMap entities;
     Node entityNode;
     String entityName;
     doc = (Document) baseT::load("staff", false);
     docType = doc.getDoctype();
     baseT::assertNotNull(docType, __LINE__, __FILE__);
     entities = docType.getEntities();
     baseT::assertNotNull(entities, __LINE__, __FILE__);
     entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1"));
     baseT::assertNotNull(entityNode, __LINE__, __FILE__);
     entityName = entityNode.getNodeName();
     baseT::assertEquals("ent1", entityName, __LINE__, __FILE__);
 
  }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:21,代码来源:nodeentitynodename.hpp

示例10: runTest

 /*
  * Runs the test case.
  */
 void runTest()
 {
    Document doc;
    DocumentType docType;
    NamedNodeMap notations;
    Notation notationNode;
    String publicId;
    doc = (Document) baseT::load("staff", false);
    docType = doc.getDoctype();
    baseT::assertNotNull(docType, __LINE__, __FILE__);
    notations = docType.getNotations();
    baseT::assertNotNull(notations, __LINE__, __FILE__);
    notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation2"));
    baseT::skipIfNull(notationNode);
    publicId = notationNode.getPublicId();
    baseT::assertNull(publicId, __LINE__, __FILE__);
    
 }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:21,代码来源:notationgetpublicidnull.hpp

示例11: runTest

   /*
    * Runs the test case.
    */
   void runTest()
   {
      Document doc;
      NodeList addressList;
      Node testNode;
      NamedNodeMap attributes;
      Attr streetAttr;
      boolean state;
      doc = (Document) baseT::load("staff", true);
      addressList = doc.getElementsByTagName(SA::construct_from_utf8("address"));
      testNode = addressList.item(2);
      ((Element) /*Node */testNode).removeAttribute(SA::construct_from_utf8("street"));
      attributes = testNode.getAttributes();
      streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("street"));
      baseT::skipIfNull(streetAttr);
      state = streetAttr.getSpecified();
      assertFalse(state);

   }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:22,代码来源:attrspecifiedvalueremove.hpp

示例12: runTest

 /*
  * Runs the test case.
  */
 void runTest()
 {
    Document doc;
    DocumentType docType;
    NamedNodeMap entities;
    Node entityNode;
    String entityValue;
    doc = (Document) baseT::load("staff", true);
    docType = doc.getDoctype();
    baseT::assertNotNull(docType, __LINE__, __FILE__);
    entities = docType.getEntities();
    baseT::assertNotNull(entities, __LINE__, __FILE__);
    entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1"));
    baseT::assertNotNull(entityNode, __LINE__, __FILE__);
    entityNode.setNodeValue(SA::construct_from_utf8("This should have no effect"));
    entityValue = entityNode.getNodeValue();
    baseT::assertNull(entityValue, __LINE__, __FILE__);
    
 }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:22,代码来源:nodeentitysetnodevalue.hpp

示例13: runTest

  /*
   * Runs the test case.
   */
  void runTest()
  {
     Document doc;
     NodeList addressList;
     Node testNode;
     NamedNodeMap attributes;
     Attr streetAttr;
     String strong1;
     String strong2;
     doc = (Document) baseT::load("hc_staff", false);
     addressList = doc.getElementsByTagName(SA::construct_from_utf8("acronym"));
     testNode = addressList.item(1);
     attributes = testNode.getAttributes();
     streetAttr = (Attr) attributes.getNamedItem(SA::construct_from_utf8("class"));
     strong1 = streetAttr.getNodeName();
     strong2 = streetAttr.getName();
     baseT::assertEquals("class", strong1, __LINE__, __FILE__);
 baseT::assertEquals("class", strong2, __LINE__, __FILE__);
 
  }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:23,代码来源:hc_attrname.hpp

示例14: notHandledByInterceptor

v8::Handle<v8::Value> V8NamedNodeMap::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.NamedNodeMap.NamedPropertyGetter");
    // Search the prototype chain first.
    v8::Handle<v8::Value> value = info.Holder()->GetRealNamedPropertyInPrototypeChain(name);
    if (!value.IsEmpty())
        return value;

    // Then look for IDL defined properties on the object itself.
    if (info.Holder()->HasRealNamedCallbackProperty(name))
        return notHandledByInterceptor();

    // Finally, search the DOM.
    NamedNodeMap* imp = V8NamedNodeMap::toNative(info.Holder());
    RefPtr<Node> result = imp->getNamedItem(toWebCoreString(name));
    if (!result)
        return notHandledByInterceptor();

    return toV8(result.release());
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:20,代码来源:V8NamedNodeMapCustom.cpp

示例15: runTest

 /*
  * Runs the test case.
  */
 void runTest()
 {
    Document doc;
    DocumentType docType;
    NamedNodeMap entityList;
    Node entity;
    doc = (Document) baseT::load("staff", false);
    docType = doc.getDoctype();
    baseT::assertNotNull(docType, __LINE__, __FILE__);
    entityList = docType.getEntities();
    baseT::assertNotNull(entityList, __LINE__, __FILE__);
    entity = entityList.getNamedItem(SA::construct_from_utf8("ent5"));
    baseT::skipIfNull(entity);
    
    if (("image/svg+xml" == baseT::getContentType())) {
        baseT::assertSize(7, entityList, __LINE__, __FILE__);
    } else {
        baseT::assertSize(5, entityList, __LINE__, __FILE__);
    }
      
  
 }
开发者ID:QuentinFiard,项目名称:arabica,代码行数:25,代码来源:documenttypegetentitieslength.hpp


注:本文中的NamedNodeMap::getNamedItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。