• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ XMLNamespaces类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中XMLNamespaces的典型用法代码示例。如果您正苦于以下问题:C++ XMLNamespaces类的具体用法?C++ XMLNamespaces怎么用?C++ XMLNamespaces使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: getPrefix

/** @cond doxygenLibsbmlInternal */
void 
ListOfGlobalRenderInformation::writeXMLNS (XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;
  xmlns.add(getURI(), getPrefix());
  stream << xmlns;
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:8,代码来源:GlobalRenderInformation.cpp


示例2:

void
RenderCubicBezier::writeXMLNS (XMLOutputStream& stream) const
{
    XMLNamespaces xmlns;
    xmlns.add(LayoutExtension::getXmlnsXSI(), "xsi");
    stream << xmlns;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:7,代码来源:RenderCubicBezier.cpp


示例3:

/*
 * Subclasses should override this method to write their XML attributes
 * to the XMLOutputStream.  Be sure to call your parents implementation
 * of this method as well.
 */
void
NUMLDocument::writeAttributes (XMLOutputStream& stream) const
{
  if (mNUMLNamespaces->getNamespaces() == 0)
  {
     XMLNamespaces xmlns;

     if (mLevel == 1)
     {
        xmlns.add("http://www.numl.org/numl/level1/version1");
     }
     stream << xmlns;

     mNUMLNamespaces->setNamespaces(&xmlns);
  }  

  NMBase::writeAttributes(stream);

  //
  // level: positiveInteger  { use="required" fixed="1" }  (L1v1)
  stream.writeAttribute("level", mLevel);


  stream.writeAttribute("version", mVersion);
}
开发者ID:TheCoSMoCompany,项目名称:biopredyn,代码行数:30,代码来源:NUMLDocument.cpp


示例4: declaredURI

bool 
SedNamespaces::isValidCombination()
{
  bool valid = true;
  bool sedmlDeclared = false;
  std::string declaredURI("");
  unsigned int version = getVersion();
  XMLNamespaces *xmlns = getNamespaces();

  if (xmlns != NULL)
  {
    int numNS = 0;

    if (xmlns->hasURI(SEDML_XMLNS_L1V1))
    {
      ++numNS;
      declaredURI.assign(SEDML_XMLNS_L1V1);
    }

    // checks if the SEDML Namespace is explicitly defined.
    for (int i=0; i < xmlns->getLength(); i++)
    {
      if (!declaredURI.empty() && 
                      xmlns->getURI(i) == declaredURI)
      {
        sedmlDeclared = true;
        break;
      }
    }
  }


  switch (getLevel())
  {
    case 1:
     switch (version)
      {
        case 1:
          // the namespaces contains the sedml namespaces
          // check it is the correct ns for the level/version
          if (sedmlDeclared)
          {
            if (declaredURI != string(SEDML_XMLNS_L1V1))
            {
              valid = false;
            }
          }
          break;
        default:
          valid = false;
          break;
        }
      break;
    default:
      valid = false;
      break;
  }

  return valid;
}
开发者ID:hovo1990,项目名称:deviser,代码行数:60,代码来源:SedNamespaces.cpp


示例5:

void
ASTBase::loadASTPlugins(SBMLNamespaces * sbmlns)
{
  if (sbmlns == NULL)
  {
    unsigned int numPkgs = SBMLExtensionRegistry::getNumRegisteredPackages();

    for (unsigned int i=0; i < numPkgs; i++)
    {
      const std::string &uri = SBMLExtensionRegistry::getRegisteredPackageName(i);
      const SBMLExtension* sbmlext = SBMLExtensionRegistry::getInstance().getExtensionInternal(uri);

      if (sbmlext && sbmlext->isEnabled())
      {

        //const std::string &prefix = xmlns->getPrefix(i);
        ASTBasePlugin* astPlugin = const_cast<ASTBasePlugin*>(sbmlext->getASTBasePlugin());
        if (astPlugin != NULL)
        {
          //// need to give the plugin infomrtaion about itself
          //astPlugin->setSBMLExtension(sbmlext);
          //astPlugin->connectToParent(this);
          mPlugins.push_back(astPlugin->clone());
        }

      }
    }
  }
  else
  {
    XMLNamespaces *xmlns = sbmlns->getNamespaces();

    if (xmlns)
    {
      int numxmlns= xmlns->getLength();
      for (int i=0; i < numxmlns; i++)
      {
        const std::string &uri = xmlns->getURI(i);
        const SBMLExtension* sbmlext = SBMLExtensionRegistry::getInstance().getExtensionInternal(uri);

        if (sbmlext && sbmlext->isEnabled())
        {
          ASTBasePlugin* astPlugin = const_cast<ASTBasePlugin*>(sbmlext->getASTBasePlugin());
          if (astPlugin != NULL)
          {
            astPlugin->setSBMLExtension(sbmlext);
            astPlugin->setPrefix(xmlns->getPrefix(i));
            astPlugin->connectToParent(this);
            mPlugins.push_back(astPlugin->clone());
          }
        }
      }
    }
  }
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:55,代码来源:ASTBase.cpp


示例6: IdList

/** @cond doxygenLibsbmlInternal */
int
CompFlatteningConverter::stripPackages()
{
  mPkgsToStrip = new IdList(getPackagesToStrip());

  unsigned int num = mPkgsToStrip->size();

  if (num == 0)
  {
    return LIBSBML_OPERATION_SUCCESS;
  }

  XMLNamespaces *ns = mDocument->getSBMLNamespaces()->getNamespaces();
  for (int i = 0; i < ns->getLength(); i++)
  {
    std::string nsURI = ns->getURI(i);
    std::string package = ns->getPrefix(i);
    if (package.empty() == true)
    {
      continue;
    }
    else if (mPkgsToStrip->contains(package) == true)
    {
      mDocument->enablePackage(nsURI, package, false);
      mDisabledPackages.insert(make_pair(nsURI, package));
    }
  }

  unsigned int count = 0;
  for (unsigned int i = 0; i < num; i++)
  {
    if (mDocument->isPackageEnabled(mPkgsToStrip->at((int)i)) == false)
    {
      count++;
    }
  }

  // setup callback that will disable the packages on submodels
  Submodel::addProcessingCallback(&DisablePackageOnChildDocuments, mPkgsToStrip);

  if (num == count)
  {
    return LIBSBML_OPERATION_SUCCESS;
  }
  else
  {
    return LIBSBML_OPERATION_FAILED;
  }
}
开发者ID:copasi,项目名称:copasi-dependencies,代码行数:50,代码来源:CompFlatteningConverter.cpp


示例7: parseLayoutId

/*
 * Creates an XMLNode that represents the layoutId annotation of the species reference from the given SpeciesReference object.
 *
 * (TODO) 
 *
 */
LIBSBML_EXTERN
XMLNode* parseLayoutId(const SimpleSpeciesReference* sr)
{
  if (!sr || !sr->isSetId()) return 0;

  XMLToken ann_token = XMLToken(XMLTriple("annotation", "", ""), XMLAttributes()); 
  XMLNode* pNode = new XMLNode(ann_token);
  XMLNamespaces xmlns = XMLNamespaces();
  xmlns.add("http://projects.eml.org/bcb/sbml/level2", "");
  XMLTriple triple = XMLTriple("layoutId", "", "");
  XMLAttributes id_att = XMLAttributes();
  id_att.add("id", sr->getId());
  XMLToken token = XMLToken(triple, id_att, xmlns); 
  XMLNode node(token);
  pNode->addChild(node);
  return pNode;
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:23,代码来源:LayoutAnnotation.cpp


示例8: getPrefix

/** @cond doxygenLibsbmlInternal */
void 
ListOfExternalModelDefinitions::writeXMLNS (XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;

  std::string prefix = getPrefix();

  if (prefix.empty())
  {
    if (getNamespaces()->hasURI(CompExtension::getXmlnsL3V1V1()))
    {
      xmlns.add(CompExtension::getXmlnsL3V1V1(),prefix);
    }
  }

  stream << xmlns;
}
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:18,代码来源:ListOfExternalModelDefinitions.cpp


示例9: getPrefix

/*
 * Writes the namespace for the Spatial package
 */
void
ListOfCoordinateComponents::writeXMLNS(XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;
  std::string prefix = getPrefix();

  if (prefix.empty())
  {
    const XMLNamespaces* thisxmlns = getNamespaces();
    if (thisxmlns && thisxmlns->hasURI(SpatialExtension::getXmlnsL3V1V1()))
    {
      xmlns.add(SpatialExtension::getXmlnsL3V1V1(), prefix);
    }
  }

  stream << xmlns;
}
开发者ID:hovo1990,项目名称:deviser,代码行数:20,代码来源:ListOfCoordinateComponents.cpp


示例10: getPrefix

/*
 * Writes the namespace for the Groups package
 */
void
ListOfGroups::writeXMLNS(XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;
  std::string prefix = getPrefix();

  if (prefix.empty())
  {
    XMLNamespaces* thisxmlns = getNamespaces();
    if (thisxmlns && thisxmlns->hasURI(GroupsExtension::getXmlnsL3V1V1()))
    {
      xmlns.add(GroupsExtension::getXmlnsL3V1V1(), prefix);
    }
  }

  stream << xmlns;
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:20,代码来源:ListOfGroups.cpp


示例11: getPrefix

/*
 * Write the namespace for the Sed package.
 */
void
SedListOfTasks::writeXMLNS(XMLOutputStream& stream) const
{
	XMLNamespaces xmlns;

	std::string prefix = getPrefix();

	if (prefix.empty())
	{
		if (getNamespaces() != NULL && !getNamespaces()->hasURI(SEDML_XMLNS_L1))
		{
			xmlns.add(SEDML_XMLNS_L1,prefix);
		}
	}

	stream << xmlns;
}
开发者ID:hsorby,项目名称:libSEDML,代码行数:20,代码来源:SedTask.cpp


示例12: getPrefix

/** @cond doxygenLibsbmlInternal */
void 
ListOfFluxBounds::writeXMLNS (XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;

  std::string prefix = getPrefix();

  if (prefix.empty())
  {
    if (getNamespaces()->hasURI(FbcExtension::getXmlnsL3V1V1()))
    {
      xmlns.add(FbcExtension::getXmlnsL3V1V1(),prefix);
    }
  }

  stream << xmlns;
}
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:18,代码来源:FluxBound.cpp


示例13: getPrefix

/*
 * Write the namespace for the Multi package.
 */
void
ListOfSpeciesTypeComponentMapInProducts::writeXMLNS(XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;

  std::string prefix = getPrefix();

  if (prefix.empty())
  {
    XMLNamespaces* thisxmlns = getNamespaces();
    if (thisxmlns && thisxmlns->hasURI(MultiExtension::getXmlnsL3V1V1()))
    {
      xmlns.add(MultiExtension::getXmlnsL3V1V1(),prefix);
    }
  }

  stream << xmlns;
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:21,代码来源:SpeciesTypeComponentMapInProduct.cpp


示例14: getPrefix

/*
 * Write the namespace for the Sed package.
 */
void
SedListOfChanges::writeXMLNS(XMLOutputStream& stream) const
{
	XMLNamespaces xmlns;

	std::string prefix = getPrefix();

	if (prefix.empty())
	{
		if (getNamespaces() != NULL && !getNamespaces()->hasURI(SEDML_XMLNS_L1) && !getNamespaces()->hasURI(SEDML_XMLNS_L1V2))
		{
			if (getVersion() == 2) xmlns.add(SEDML_XMLNS_L1V2,prefix);
			else xmlns.add(SEDML_XMLNS_L1V2,prefix);
		}
	}

	stream << xmlns;
}
开发者ID:jeicher,项目名称:libSEDML,代码行数:21,代码来源:SedChange.cpp


示例15: XMLNamespaces

XMLNode*
UncertMLNode::constructXMLNode() const
{
  /* create the top level UncertML element */
  /* create Namespaces*/
  XMLNamespaces xmlns = XMLNamespaces();
  xmlns.add("http://www.uncertml.org/3.0");

  XMLTriple top_triple = XMLTriple("UncertML", 
    "http://www.uncertml.org/3.0", "");
  
  XMLAttributes blank_att = XMLAttributes();
 
  XMLNode * xml = new XMLNode(top_triple, blank_att, xmlns);

  xml->addChild(*(reconstructXML()));

  return xml;
}
开发者ID:TheCoSMoCompany,项目名称:biopredyn,代码行数:19,代码来源:UncertMLNode.cpp


示例16: getPrefix

/*
 * Writes the namespace for the Render package
 */
void
ListOfGlobalRenderInformation::writeXMLNS(XMLOutputStream& stream) const
{
  XMLNamespaces xmlns;
  std::string prefix = getPrefix();

  if (prefix.empty())
  {
    const XMLNamespaces* thisxmlns = getNamespaces();
    if (thisxmlns && thisxmlns->hasURI(RenderExtension::getXmlnsL3V1V1()))
    {
      xmlns.add(RenderExtension::getXmlnsL3V1V1(), prefix);
    }
  }
  else
  {
    xmlns.add(getURI(), getPrefix());
  }

  stream << xmlns;
}
开发者ID:copasi,项目名称:copasi-dependencies,代码行数:24,代码来源:ListOfGlobalRenderInformation.cpp


示例17:

void
SBMLLevelVersionConverter::updatePackages(unsigned int targetVersion)
{
  // this will only work if we have a package with version 1 for both l3v1 and l3v2
  //std::string sbml = writeSBMLToStdString(mDocument);
  //SBMLDocument *tempdoc = readSBMLFromString(sbml.c_str());
  //if (!tempdoc->getErrorLog()->contains(InvalidPackageLevelVersion))
  //{
  //  delete tempdoc;
  //  return;
  //}
  //delete tempdoc;

//  const SBMLExtension* sbmlext = NULL;
  XMLNamespaces *xmlns = mDocument->getNamespaces();
  int numxmlns = xmlns->getLength();
  for (int i = numxmlns - 1; i >= 0; i--)
  {
    const std::string &prefix = xmlns->getPrefix(i);
    if (!prefix.empty())
      mDocument->updateSBMLNamespace(prefix, 3, targetVersion);
  }
}
开发者ID:copasi,项目名称:copasi-dependencies,代码行数:23,代码来源:SBMLLevelVersionConverter.cpp


示例18: getXmlNodeForSBase

LIBSBML_EXTERN XMLNode getXmlNodeForSBase(const SBase* object)
{
  char* rawsbml = const_cast<SBase*>(object)->toSBML();  
  SBMLNamespaces *sbmlns = object->getSBMLNamespaces();
  XMLNamespaces* xmlns = sbmlns->getNamespaces()->clone();
  // in rare cases the above returns a package element with default namespace, however the 
  // XMLNamespaces would then assign the actual default namespace, which is in most cases
  // the SBML namespace. In that case we adjust the default namespace here
  ISBMLExtensionNamespaces *extns = dynamic_cast<ISBMLExtensionNamespaces*>(sbmlns);
  if (extns != NULL)
  {
    xmlns->remove("");
    xmlns->add(xmlns->getURI(extns->getPackageName()), "");    
  }

  XMLNode* tmp = XMLNode::convertStringToXMLNode(rawsbml, xmlns);
  if (tmp == NULL) return XMLNode();
  XMLNode result(*tmp);
  delete tmp;
  delete xmlns;
  free(rawsbml);
  return result;
}
开发者ID:sbmlteam,项目名称:python-libsbml,代码行数:23,代码来源:LayoutUtilities.cpp


示例19: DisablePackageOnChildDocuments

// simple callback disabling packages on child documents
int DisablePackageOnChildDocuments(Model* m, SBMLErrorLog *, void* userdata)
{
  if (m == NULL) return LIBSBML_OPERATION_FAILED;

  IdList *pkgsToStrip = static_cast<IdList*>(userdata);

  XMLNamespaces *ns = m->getSBMLNamespaces()->getNamespaces();
  for (int i = 0; i < ns->getLength(); i++)
  {
    std::string nsURI = ns->getURI(i);
    std::string package = ns->getPrefix(i);
    if (package.empty() == true)
    {
      continue;
    }
    else if (pkgsToStrip->contains(package) == true)
    {
      m->enablePackageInternal(nsURI, package, false);
    }
  }

  return LIBSBML_OPERATION_SUCCESS;
}
开发者ID:copasi,项目名称:copasi-dependencies,代码行数:24,代码来源:CompFlatteningConverter.cpp


示例20: XMLNamespaces

XMLNode * 
RDFAnnotationParser::createRDFAnnotation()
{
  /* create Namespaces - these go on the RDF element */
  XMLNamespaces xmlns = XMLNamespaces();
  xmlns.add("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf");
  xmlns.add("http://purl.org/dc/elements/1.1/", "dc");
  xmlns.add("http://purl.org/dc/terms/", "dcterms");
  xmlns.add("http://www.w3.org/2001/vcard-rdf/3.0#", "vCard");
  xmlns.add("http://biomodels.net/biology-qualifiers/", "bqbiol");
  xmlns.add("http://biomodels.net/model-qualifiers/", "bqmodel");

  XMLTriple RDF_triple = XMLTriple("RDF", 
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdf");
  
  XMLAttributes blank_att = XMLAttributes();
 
  XMLToken RDF_token = XMLToken(RDF_triple, blank_att, xmlns);

  return new XMLNode(RDF_token);
}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:22,代码来源:RDFAnnotation.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ XMLNode类代码示例发布时间:2022-05-31
下一篇:
C++ XMLInputStream类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap