本文整理汇总了C++中XMLToken::getNamespaces方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLToken::getNamespaces方法的具体用法?C++ XMLToken::getNamespaces怎么用?C++ XMLToken::getNamespaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLToken
的用法示例。
在下文中一共展示了XMLToken::getNamespaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mTriple
/*
* Copy constructor; creates a copy of this XMLToken.
*/
XMLToken::XMLToken(const XMLToken& orig)
: mTriple()
, mAttributes()
, mNamespaces()
, mChars (orig.mChars)
, mIsStart (orig.mIsStart)
, mIsEnd (orig.mIsEnd)
, mIsText (orig.mIsText)
, mLine (orig.mLine)
, mColumn (orig.mColumn)
{
if (!orig.mTriple.isEmpty())
mTriple = XMLTriple(orig.getName(), orig.getURI(), orig.getPrefix());
if (!orig.mAttributes.isEmpty())
mAttributes = XMLAttributes(orig.getAttributes());
if (!orig.mNamespaces.isEmpty())
mNamespaces = XMLNamespaces(orig.getNamespaces());
}
示例2: logError
/*
* Subclasses should override this method to read (and store) XHTML,
* MathML, etc. directly from the XMLInputStream.
*
* @return true if the subclass read from the stream, false otherwise.
*/
bool
InitialAssignment::readOtherXML (XMLInputStream& stream)
{
bool read = false;
const string& name = stream.peek().getName();
if (name == "math")
{
// if this is level 1 there shouldnt be any math!!!
if (getLevel() == 1)
{
logError(NotSchemaConformant, getLevel(), getVersion(),
"SBML Level 1 does not support MathML.");
delete mMath;
return false;
}
if (mMath)
{
if (getLevel() < 3)
{
logError(NotSchemaConformant, getLevel(), getVersion(),
"Only one <math> element is permitted inside a "
"particular containing element.");
}
else
{
logError(OneMathElementPerInitialAssign, getLevel(), getVersion());
}
}
/* check for MathML namespace
* this may be explicitly declared here
* or implicitly declared on the whole document
*/
const XMLToken elem = stream.peek();
unsigned int match = 0;
int n;
if (elem.getNamespaces().getLength() != 0)
{
for (n = 0; n < elem.getNamespaces().getLength(); n++)
{
if (!strcmp(elem.getNamespaces().getURI(n).c_str(), "http://www.w3.org/1998/Math/MathML"))
{
match = 1;
break;
}
}
}
if (match == 0)
{
if( mSBML->getNamespaces() != NULL)
/* check for implicit declaration */
{
for (n = 0; n < mSBML->getNamespaces()->getLength(); n++)
{
if (!strcmp(mSBML->getNamespaces()->getURI(n).c_str(),
"http://www.w3.org/1998/Math/MathML"))
{
match = 1;
break;
}
}
}
}
if (match == 0)
{
logError(InvalidMathElement);
}
delete mMath;
mMath = readMathML(stream);
if (mMath) mMath->setParentSBMLObject(this);
read = true;
}
return read;
}