本文整理汇总了C++中Stylesheet::getNamespaces方法的典型用法代码示例。如果您正苦于以下问题:C++ Stylesheet::getNamespaces方法的具体用法?C++ Stylesheet::getNamespaces怎么用?C++ Stylesheet::getNamespaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stylesheet
的用法示例。
在下文中一共展示了Stylesheet::getNamespaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ElemVariable::init(
StylesheetConstructionContext& constructionContext,
Stylesheet& stylesheetTree,
const AttributeListType& atts)
{
const unsigned int nAttrs = atts.getLength();
for(unsigned int i = 0; i < nAttrs; i++)
{
const XalanDOMChar* const aname = atts.getName(i);
if (equals(aname, Constants::ATTRNAME_SELECT))
{
m_selectPattern = constructionContext.createXPath(getLocator(), atts.getValue(i), *this);
}
else if (equals(aname, Constants::ATTRNAME_NAME))
{
m_qname = constructionContext.createXalanQName(
atts.getValue(i),
stylesheetTree.getNamespaces(),
getLocator());
if (m_qname->isValid() == false)
{
constructionContext.error(
XalanMessageLoader::getMessage(
XalanMessages::AttributeValueNotValidQName_2Param,
Constants::ATTRNAME_NAME.c_str(),
atts.getValue(i)),
0,
this);
}
}
else if(!(isAttrOK(aname, atts, i, constructionContext) ||
processSpaceAttr(aname, atts, i, constructionContext)))
{
constructionContext.error(
XalanMessageLoader::getMessage(
XalanMessages::TemplateHasIllegalAttribute_2Param,
Constants::ELEMNAME_VARIABLE_WITH_PREFIX_STRING.c_str(),
aname),
0,
this);
}
}
if(m_qname == 0)
{
constructionContext.error(
XalanMessageLoader::getMessage(
XalanMessages::TemplateMustHaveAttribute_2Param,
Constants::ELEMNAME_VARIABLE_WITH_PREFIX_STRING,
Constants::ATTRNAME_NAME),
0,
this);
}
}
示例2: if
XALAN_CPP_NAMESPACE_BEGIN
ElemAttributeSet::ElemAttributeSet(
StylesheetConstructionContext& constructionContext,
Stylesheet& stylesheetTree,
const AttributeListType& atts,
XalanFileLoc lineNumber,
XalanFileLoc columnNumber) :
ElemUse(constructionContext,
stylesheetTree,
lineNumber,
columnNumber,
StylesheetConstructionContext::ELEMNAME_ATTRIBUTE_SET),
m_qname(0)
{
const XalanSize_t nAttrs = atts.getLength();
for (XalanSize_t i = 0; i < nAttrs; i++)
{
const XalanDOMChar* const aname = atts.getName(i);
if (equals(aname, Constants::ATTRNAME_NAME))
{
m_qname = constructionContext.createXalanQName(
atts.getValue(i),
stylesheetTree.getNamespaces(),
getLocator());
if (m_qname->isValid() == false)
{
error(
constructionContext,
XalanMessages::AttributeValueNotValidQName_2Param,
aname,
atts.getValue(i));
}
}
else if (processUseAttributeSets(
constructionContext,
aname,
atts,
i) == false &&
isAttrOK(
aname,
atts,
i,
constructionContext) == false)
{
error(
constructionContext,
XalanMessages::ElementHasIllegalAttribute_2Param,
Constants::ELEMNAME_ATTRIBUTESET_WITH_PREFIX_STRING.c_str(),
aname);
}
}
if (m_qname == 0)
{
error(
constructionContext,
XalanMessages::ElementMustHaveAttribute_2Param,
Constants::ELEMNAME_ATTRIBUTESET_WITH_PREFIX_STRING,
Constants::ATTRNAME_NAME);
}
assert(m_qname->isValid() == true);
}