本文整理汇总了C++中StylesheetConstructionContext::allocateAVTPointerVector方法的典型用法代码示例。如果您正苦于以下问题:C++ StylesheetConstructionContext::allocateAVTPointerVector方法的具体用法?C++ StylesheetConstructionContext::allocateAVTPointerVector怎么用?C++ StylesheetConstructionContext::allocateAVTPointerVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StylesheetConstructionContext
的用法示例。
在下文中一共展示了StylesheetConstructionContext::allocateAVTPointerVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ElemLiteralResult::init(
StylesheetConstructionContext& constructionContext,
Stylesheet& stylesheetTree,
const XalanDOMChar* name,
const AttributeListType& atts)
{
assert(name != 0);
hasPrefix(indexOf(name, XalanUnicode::charColon) < length(name) ? true : false);
const unsigned int nAttrs = atts.getLength();
// This over-allocates, but we probably won't waste that much space.
m_avts = constructionContext.allocateAVTPointerVector(nAttrs);
assert(m_avts != 0);
const StylesheetConstructionContext::GetAndReleaseCachedString theGuard(constructionContext);
XalanDOMString& theBuffer = theGuard.get();
for(unsigned int i = 0; i < nAttrs; i++)
{
const XalanDOMChar* const aname = atts.getName(i);
bool needToProcess = true;
const XalanDOMString::size_type indexOfNSSep = indexOf(aname, XalanUnicode::charColon);
const XalanDOMString::size_type len = length(aname);
if(indexOfNSSep < len)
{
substring(aname, theBuffer, 0, indexOfNSSep);
if(!equals(theBuffer, DOMServices::s_XMLNamespace))
{
const XalanDOMString* const ns =
getNamespaceForPrefixInternal(theBuffer);
if(ns == 0)
{
constructionContext.error(
XalanMessageLoader::getMessage(XalanMessages::UndeclaredNamespacePrefix_1Param, theBuffer),
0,
this);
}
else if(equals(*ns, stylesheetTree.getXSLTNamespaceURI()))
{
theBuffer.assign(aname + indexOfNSSep + 1, len - (indexOfNSSep + 1));
if(processPrefixControl(constructionContext, stylesheetTree, theBuffer, atts.getValue(i)) == true)
{
needToProcess = false;
}
else if (equals(theBuffer, Constants::ATTRNAME_VERSION) == true)
{
const XalanDOMChar* const value = atts.getValue(i);
stylesheetTree.setXSLTVerDeclared(DoubleSupport::toDouble(value));
}
}
}
else
{
// don't process namespace decls
needToProcess = false;
}
}
if(needToProcess == true)
{
processSpaceAttr(aname, atts, i, constructionContext);
// Add xmlns attribute(except xmlns:xsl), xml:space, etc...
// Ignore anything with xsl:xxx
if(! processUseAttributeSets(constructionContext, aname, atts, i) &&
isAttrOK(aname, atts, i, constructionContext))
{
m_avts[m_avtsCount++] =
constructionContext.createAVT(getLocator(), aname, atts.getValue(i), *this);
}
}
}
}