本文整理汇总了C++中DbXmlConfiguration::addImpliedSchemaNode方法的典型用法代码示例。如果您正苦于以下问题:C++ DbXmlConfiguration::addImpliedSchemaNode方法的具体用法?C++ DbXmlConfiguration::addImpliedSchemaNode怎么用?C++ DbXmlConfiguration::addImpliedSchemaNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbXmlConfiguration
的用法示例。
在下文中一共展示了DbXmlConfiguration::addImpliedSchemaNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSchemaForIndex
void ProjectionSchemaAdjuster::addSchemaForIndex(PresenceQP *item)
{
XPath2MemoryManager *mm = context_->getMemoryManager();
DbXmlConfiguration *conf = GET_CONFIGURATION(context_);
ContainerBase *container = item->getContainerBase();
// We need to add a document projection schema for and DLS+ index lookups,
// to make sure that the node it points to is still in the projected tree
if(container != 0 && container->getContainer() != 0 &&
container->getContainer()->isWholedocContainer() && container->nodesIndexed() &&
!item->isDocumentIndex() && item->getNodeType() != ImpliedSchemaNode::METADATA) {
DbXmlNodeTest *nt = new (mm) DbXmlNodeTest(Node::document_string);
ImpliedSchemaNode *root = new (mm) ImpliedSchemaNode(nt, ImpliedSchemaNode::ROOT, mm);
roots_.push_back(root);
Name cname(item->getChildName());
const char *curi = cname.hasURI() ? cname.getURI() : 0;
switch(item->getNodeType()) {
case ImpliedSchemaNode::ATTRIBUTE: {
ImpliedSchemaNode::Type type = ImpliedSchemaNode::DESCENDANT_ATTR;
ImpliedSchemaNode *pisn = root;
if(item->isParentSet()) {
Name pname(item->getParentName());
const char *puri = pname.hasURI() ? pname.getURI() : 0;
DbXmlNodeTest *nt2 = new (mm) DbXmlNodeTest(Node::element_string,
mm->getPooledString(puri), mm->getPooledString(pname.getName()), mm);
pisn = new (mm) ImpliedSchemaNode(nt2, ImpliedSchemaNode::DESCENDANT, mm);
pisn = (ImpliedSchemaNode*)root->appendChild(pisn);
type = ImpliedSchemaNode::ATTRIBUTE;
}
DbXmlNodeTest *nt = new (mm) DbXmlNodeTest(Node::attribute_string,
mm->getPooledString(curi), mm->getPooledString(cname.getName()), mm);
pisn->appendChild(new (mm) ImpliedSchemaNode(nt, type, mm));
break;
}
case ImpliedSchemaNode::CHILD:
case ImpliedSchemaNode::DESCENDANT: {
DbXmlNodeTest *nt = new (mm) DbXmlNodeTest(Node::element_string,
mm->getPooledString(curi), mm->getPooledString(cname.getName()), mm);
root->appendChild(new (mm) ImpliedSchemaNode(nt, ImpliedSchemaNode::DESCENDANT, mm));
break;
}
default: break;
}
conf->addImpliedSchemaNode(container->getContainerID(), root);
}
}