本文整理汇总了C++中QName::getURI方法的典型用法代码示例。如果您正苦于以下问题:C++ QName::getURI方法的具体用法?C++ QName::getURI怎么用?C++ QName::getURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QName
的用法示例。
在下文中一共展示了QName::getURI方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAttDef
// ---------------------------------------------------------------------------
// XercesAttGroupInfo: Getter methods
// ---------------------------------------------------------------------------
const SchemaAttDef* XercesAttGroupInfo::getAttDef(const XMLCh* const baseName,
const int uriId) const {
// If no list, then return a null
if (!fAttributes)
return 0;
XMLSize_t attSize = fAttributes->size();
for (XMLSize_t i=0; i<attSize; i++) {
const SchemaAttDef* attDef = fAttributes->elementAt(i);
QName* attName = attDef->getAttName();
if (uriId == (int) attName->getURI() &&
XMLString::equals(baseName, attName->getLocalPart())) {
return attDef;
}
}
return 0;
}
示例2: containsAttribute
bool XercesAttGroupInfo::containsAttribute(const XMLCh* const name,
const unsigned int uri) {
if (fAttributes) {
XMLSize_t attCount = fAttributes->size();
if (attCount) {
for (XMLSize_t i=0; i < attCount; i++) {
QName* attName = fAttributes->elementAt(i)->getAttName();
if (attName->getURI() == uri &&
XMLString::equals(attName->getLocalPart(),name)) {
return true;
}
}
}
}
return false;
}
示例3: validateContentSpecial
int MixedContentModel::validateContentSpecial(QName** const children
, const unsigned int childCount
, const unsigned int
, GrammarResolver* const pGrammarResolver
, XMLStringPool* const pStringPool) const
{
SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool);
// must match order
if (fOrdered) {
unsigned int inIndex = 0;
for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) {
// Get the current child out of the source index
QName* curChild = children[outIndex];
// If its PCDATA, then we just accept that
if (curChild->getURI() == XMLElementDecl::fgPCDataElemId)
continue;
ContentSpecNode::NodeTypes type = fChildTypes[inIndex];
QName* inChild = fChildren[inIndex];
if (type == ContentSpecNode::Leaf) {
if ( !comparator.isEquivalentTo(curChild, inChild))
return outIndex;
}
else if (type == ContentSpecNode::Any) {
}
else if (type == ContentSpecNode::Any_NS) {
if (inChild->getURI() != curChild->getURI())
return outIndex;
}
else if (type == ContentSpecNode::Any_Other) {
if (inChild->getURI() == curChild->getURI())
return outIndex;
}
// advance index
inIndex++;
}
}
// can appear in any order
else {
for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) {
// Get the current child out of the source index
QName* curChild = children[outIndex];
// If its PCDATA, then we just accept that
if (curChild->getURI() == XMLElementDecl::fgPCDataElemId)
continue;
// And try to find it in our list
unsigned int inIndex = 0;
for (; inIndex < fCount; inIndex++)
{
ContentSpecNode::NodeTypes type = fChildTypes[inIndex];
QName* inChild = fChildren[inIndex];
if (type == ContentSpecNode::Leaf) {
if ( comparator.isEquivalentTo(curChild, inChild))
break;
}
else if (type == ContentSpecNode::Any) {
break;
}
else if (type == ContentSpecNode::Any_NS) {
if (inChild->getURI() == curChild->getURI())
break;
}
else if (type == ContentSpecNode::Any_Other) {
if (inChild->getURI() != curChild->getURI())
break;
}
// REVISIT: What about checking for multiple ANY matches?
// The content model ambiguity *could* be checked
// by the caller before constructing the mixed
// content model.
}
// We did not find this one, so the validation failed
if (inIndex == fCount)
return outIndex;
}
}
// Everything seems to be in order, so return success
// success
return -1;
}
示例4: validateContentSpecial
int DFAContentModel::validateContentSpecial(QName** const children
, const unsigned int childCount
, const unsigned int
, GrammarResolver* const pGrammarResolver
, XMLStringPool* const pStringPool) const
{
SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool);
if (childCount == 0)
return fEmptyOk ? -1 : 0;
//
// Lets loop through the children in the array and move our way
// through the states. Note that we use the fElemMap array to map
// an element index to a state index.
//
unsigned int curState = 0;
unsigned int nextState = 0;
unsigned int childIndex = 0;
for (; childIndex < childCount; childIndex++)
{
// Get the current element index out
QName* curElem = children[childIndex];
// If this is text in a Schema mixed content model, skip it.
if ( fIsMixed &&
( curElem->getURI() == XMLElementDecl::fgPCDataElemId))
continue;
// Look up this child in our element map
unsigned int elemIndex = 0;
for (; elemIndex < fElemMapSize; elemIndex++)
{
QName* inElem = fElemMap[elemIndex];
ContentSpecNode::NodeTypes type = fElemMapType[elemIndex];
if (type == ContentSpecNode::Leaf)
{
if (comparator.isEquivalentTo(curElem, inElem) )
{
nextState = fTransTable[curState][elemIndex];
if (nextState != XMLContentModel::gInvalidTrans)
break;
}
}
else if ((type & 0x0f)== ContentSpecNode::Any)
{
nextState = fTransTable[curState][elemIndex];
if (nextState != XMLContentModel::gInvalidTrans)
break;
}
else if ((type & 0x0f) == ContentSpecNode::Any_NS)
{
if (inElem->getURI() == curElem->getURI())
{
nextState = fTransTable[curState][elemIndex];
if (nextState != XMLContentModel::gInvalidTrans)
break;
}
}
else if ((type & 0x0f) == ContentSpecNode::Any_Other)
{
if (inElem->getURI() != curElem->getURI())
{
nextState = fTransTable[curState][elemIndex];
if (nextState != XMLContentModel::gInvalidTrans)
break;
}
}
}//for elemIndex
// If "nextState" is -1, we found a match, but the transition is invalid
if (nextState == XMLContentModel::gInvalidTrans)
return childIndex;
// If we didn't find it, then obviously not valid
if (elemIndex == fElemMapSize)
return childIndex;
curState = nextState;
nextState = 0;
}//for childIndex
//
// We transitioned all the way through the input list. However, that
// does not mean that we ended in a final state. So check whether
// our ending state is a final state.
//
if (!fFinalStateFlags[curState])
return childIndex;
//success
return -1;
}