当前位置: 首页>>代码示例>>C++>>正文


C++ StylesheetConstructionContext类代码示例

本文整理汇总了C++中StylesheetConstructionContext的典型用法代码示例。如果您正苦于以下问题:C++ StylesheetConstructionContext类的具体用法?C++ StylesheetConstructionContext怎么用?C++ StylesheetConstructionContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了StylesheetConstructionContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
ElemVariable::addToStylesheet(
			StylesheetConstructionContext&	constructionContext,
			Stylesheet&						theStylesheet)
{
	// Processing a top-level element only...
	if (&theStylesheet != &getStylesheet())
	{
		constructionContext.error(
			XalanMessageLoader::getMessage(XalanMessages::ElemVariableInstanceAddedToWrongStylesheet),
			0,
			this);
	}
	else if (getParentNodeElem() != 0)
	{
		constructionContext.error(
			XalanMessageLoader::getMessage(XalanMessages::ElemVariableInstanceIsAlreadyParented),
			0,
			this);
	}
	else
	{
		theStylesheet.setTopLevelVariable(this);

		m_isTopLevel = true;
	}
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例2: addOrUpdateByPrefix

bool
addOrUpdateByPrefix(
            StylesheetConstructionContext&  theConstructionContext,
            VectorType&                     theVector,
            const XalanDOMString&           thePrefix,
            const XalanDOMString&           theURI)
{
    typedef typename VectorType::value_type     value_type;

    value_type* const   theEntry =
        findByPrefixNonConst(theVector, thePrefix);

    if (theEntry == 0)
    {
        theVector.push_back(
            value_type(
                theConstructionContext.getPooledString(thePrefix),
                theConstructionContext.getPooledString(theURI)));

        return true;
    }
    else
    {
        if (theEntry->getURI() == theURI)
        {
            return false;
        }
        else
        {
            theEntry->setURI(theConstructionContext.getPooledString(theURI));

            return true;
        }
    }
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:35,代码来源:NamespacesHandler.cpp

示例3: equals

bool
ElemUse::processUseAttributeSets(
			StylesheetConstructionContext&	constructionContext,
			const XalanDOMChar*				attrName,
			const AttributeListType&		atts,
			int								which)
{
	bool isUAS = false;

	if(StylesheetConstructionContext::ELEMNAME_LITERAL_RESULT == getXSLToken())
	{
		isUAS = constructionContext.isXSLUseAttributeSetsAttribute(
			attrName,
			getStylesheet(),
			getLocator());
	}
	else
	{
		isUAS = equals(attrName, Constants::ATTRNAME_USEATTRIBUTESETS);
	}

	if(isUAS == true)
	{
		m_attributeSetsNames =
			constructionContext.tokenizeQNames(
				m_attributeSetsNamesCount,
				atts.getValue(which),
				getStylesheet().getNamespaces(),
				getLocator());
		assert(m_attributeSetsNamesCount == 0 || m_attributeSetsNames != 0);
	}

	return isUAS;
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:34,代码来源:ElemUse.cpp

示例4: addByPrefix

NamespacesHandler::NamespacesHandler(
            StylesheetConstructionContext&  theConstructionContext,
            const NamespacesHandler&        /* stylesheetNamespacesHandler */,
            const NamespacesStackType&      theCurrentNamespaces,
            const XalanDOMString&           theXSLTNamespaceURI) :
    m_excludedResultPrefixes(theConstructionContext.getMemoryManager()),
    m_namespaceDeclarations(theConstructionContext.getMemoryManager()),
    m_extensionNamespaceURIs(theConstructionContext.getMemoryManager()),
    m_namespaceAliases(theConstructionContext.getMemoryManager())
{
    // Go through the namespaces stack in reverse order...
    const NamespacesStackType::const_reverse_iterator   theEnd =
        theCurrentNamespaces.rend();

    NamespacesStackType::const_reverse_iterator     i =
        theCurrentNamespaces.rbegin();

    for(; i != theEnd; ++i)
    {
        // Process each namespace in the current vector...
        const NamespaceVectorType::const_iterator   theVectorEnd =
            (*i).end();

        NamespaceVectorType::const_iterator         j =
            (*i).begin();

        for(; j != theVectorEnd; ++j)
        {
            const NameSpace&        theNamespace = *j;

            const XalanDOMString&   theURI = theNamespace.getURI();

            const XalanDOMString&   thePrefix = theNamespace.getPrefix();

            if(shouldExcludeResultNamespaceNode(
                    theXSLTNamespaceURI,
                    theURI) == false)
            {
                addByPrefix(
                    theConstructionContext,
                    m_namespaceDeclarations,
                    thePrefix,
                    theURI);
            }
            else
            {
                addByPrefix(
                    theConstructionContext,
                    m_excludedResultPrefixes,
                    thePrefix,
                    theURI);

                assert(findByPrefix(m_excludedResultPrefixes, thePrefix) != 0 &&
                       findByPrefix(m_excludedResultPrefixes, thePrefix)->getURI() == theURI);
            }
        }
    }
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:58,代码来源:NamespacesHandler.cpp

示例5:

void
NamespacesHandler::setNamespaceAlias(
            StylesheetConstructionContext&  theConstructionContext,
            const XalanDOMString&           theStylesheetNamespace,
            const XalanDOMString&           theResultNamespace)
{
    m_namespaceAliases[&theConstructionContext.getPooledString(theStylesheetNamespace)] =
        &theConstructionContext.getPooledString(theResultNamespace);
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:9,代码来源:NamespacesHandler.cpp

示例6: ElemTemplateElement

XALAN_CPP_NAMESPACE_BEGIN



ElemForEach::ElemForEach(
			StylesheetConstructionContext&	constructionContext,
			Stylesheet&						stylesheetTree,
			const AttributeListType&		atts,
			int								lineNumber,
			int								columnNumber) :
	ElemTemplateElement(constructionContext,
						stylesheetTree,
						lineNumber,
						columnNumber,
						StylesheetConstructionContext::ELEMNAME_FOR_EACH),
	m_selectPattern(0),
	m_sortElems(),
	m_sortElemsCount(0)
{
	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(!(isAttrOK(aname, atts, i, constructionContext) ||
				processSpaceAttr(aname, atts, i, constructionContext)))
		{
			constructionContext.error(
					XalanMessageLoader::getMessage(
						XalanMessages::TemplateHasIllegalAttribute_2Param,
							Constants::ELEMNAME_FOREACH_WITH_PREFIX_STRING.c_str(),
							aname),
					0,
					this);
		}
	}

	if(0 == m_selectPattern)
	{
		constructionContext.error(
			XalanMessageLoader::getMessage(
				XalanMessages::TemplateMustHaveAttribute_2Param,
				Constants::ELEMNAME_FOREACH_WITH_PREFIX_STRING,
				Constants::ATTRNAME_SELECT),
			0,
			this);
	}
}
开发者ID:,项目名称:,代码行数:53,代码来源:

示例7: ElemTemplateElement

XALAN_CPP_NAMESPACE_BEGIN



ElemTextLiteral::ElemTextLiteral(
            StylesheetConstructionContext&  constructionContext,
            Stylesheet&                     stylesheetTree,
            XalanFileLoc                    lineNumber, 
            XalanFileLoc                    columnNumber,
            const XMLCh*                    ch,
            XalanDOMString::size_type       start,
            XalanDOMString::size_type       length,
            bool                            fPreserveSpace,
            bool                            fDisableOutputEscaping) :
    ElemTemplateElement(
        constructionContext,
        stylesheetTree,
        StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT,
        stylesheetTree.getBaseIdentifier(),
        lineNumber,
        columnNumber),
    m_isWhitespace(isXMLWhitespace(ch, start, length)),
    // Always null-terminate our buffer, since we may need it that way.
    m_ch(constructionContext.allocateXalanDOMCharVector(ch + start, length, true)),
    m_length(length)
{
    disableOutputEscaping(fDisableOutputEscaping);

    preserveSpace(fPreserveSpace);
}
开发者ID:apache,项目名称:xalan-c,代码行数:30,代码来源:ElemTextLiteral.cpp

示例8: ElemLiteralResult

XALAN_CPP_NAMESPACE_BEGIN



ElemExtensionCall::ElemExtensionCall(
            StylesheetConstructionContext&  constructionContext,
            Stylesheet&                     stylesheetTree,
            const XalanDOMChar*             name,
            const AttributeListType&        atts,
            int                             lineNumber,
            int                             columnNumber,
            ExtensionNSHandler&             ns) :
    ElemLiteralResult(constructionContext,
        stylesheetTree,
        name,
        atts,
        lineNumber,
        columnNumber,
        StylesheetConstructionContext::ELEMNAME_EXTENSION_CALL),
    m_qname(
        constructionContext.createXalanQName(
            name,
            getStylesheet().getNamespaces(),
            getLocator())),
    m_nsh(ns)
{
    assert(m_qname != 0);
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:28,代码来源:ElemExtensionCall.cpp

示例9: ElemTemplateElement

XALAN_CPP_NAMESPACE_BEGIN



ElemPI::ElemPI(
            StylesheetConstructionContext&  constructionContext,
            Stylesheet&                     stylesheetTree,
            const AttributeListType&        atts,
            XalanFileLoc                    lineNumber, 
            XalanFileLoc                    columnNumber) :
    ElemTemplateElement(
        constructionContext,
        stylesheetTree,
        lineNumber,
        columnNumber,
        StylesheetConstructionContext::ELEMNAME_PI),
    m_nameAVT(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_nameAVT =
                    constructionContext.createAVT(getLocator(), aname, atts.getValue(i), *this);
        }
        else if (isAttrOK(
                    aname,
                    atts,
                    i,
                    constructionContext) == false &&
                 processSpaceAttr(
                    Constants::ELEMNAME_PI_WITH_PREFIX_STRING.c_str(),
                    aname,
                    atts,
                    i,
                    constructionContext) == false)
        {
            error(
                constructionContext,
                XalanMessages::ElementHasIllegalAttribute_2Param,
                Constants::ELEMNAME_PI_WITH_PREFIX_STRING.c_str(),
                aname);
        }
    }

    if (0 == m_nameAVT)
    {
        error(
            constructionContext,
            XalanMessages::ElementMustHaveAttribute_2Param,
            Constants::ELEMNAME_PI_WITH_PREFIX_STRING,
            Constants::ATTRNAME_NAME);
    }
}
开发者ID:apache,项目名称:xalan-c,代码行数:58,代码来源:ElemPI.cpp

示例10: tokenizer

void
NamespacesHandler::processExtensionElementPrefixes(
            StylesheetConstructionContext&  theConstructionContext,
            const XalanDOMChar*             theValue,
            const NamespacesStackType&      theCurrentNamespaces)
{
    typedef StylesheetConstructionContext::GetAndReleaseCachedString    GetAndReleaseCachedString;

    StringTokenizer     tokenizer(
                    theValue,
                    Constants::DEFAULT_WHITESPACE_SEPARATOR_STRING);

    const GetAndReleaseCachedString     theGuard(theConstructionContext);

    XalanDOMString&     thePrefix = theGuard.get();

    while(tokenizer.hasMoreTokens() == true)
    {
        tokenizer.nextToken(thePrefix);

        if(equalsIgnoreCaseASCII(thePrefix, Constants::ATTRVAL_DEFAULT_PREFIX) == true)
        {
            thePrefix.clear();
        }

        const XalanDOMString* const     theNamespace =
            XalanQName::getNamespaceForPrefix(theCurrentNamespaces, thePrefix);

        if(theNamespace == 0)
        {
            GetAndReleaseCachedString   theGuard(theConstructionContext);

            theConstructionContext.error(
                XalanMessageLoader::getMessage(
                    theGuard.get(),
                    XalanMessages::PrefixIsNotDeclared_1Param,
                    thePrefix));
        }

        assert(theNamespace != 0);

        m_extensionNamespaceURIs.push_back(&theConstructionContext.getPooledString(*theNamespace));
    }
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:44,代码来源:NamespacesHandler.cpp

示例11: while

void
NamespacesHandler::processExcludeResultPrefixes(
            StylesheetConstructionContext&  theConstructionContext,
            const XalanDOMString&           theElementPrefix,
            const PrefixChecker*            prefixChecker)
{
    if (m_excludedResultPrefixes.empty() == false)
    {
        NamespaceExtendedVectorType::iterator       i =
                m_namespaceDeclarations.begin();

        // Check for any result prefixes we should exclude...
        while(i != m_namespaceDeclarations.end())
        {
            const Namespace&        theNamespace = *i;

            const XalanDOMString&   thePrefix = theNamespace.getPrefix();
            const XalanDOMString&   theURI = theNamespace.getURI();

            // We can never exclude the prefix of our owner element, so
            // check that first...
            if (equals(thePrefix, theElementPrefix) == false &&
                (prefixChecker == 0 || prefixChecker->isActive(thePrefix) == false) &&
                (isExcludedNamespaceURI(theURI) == true ||
                 isExtensionNamespaceURI(theURI) == true))
            {
                // Add it to the excluded prefixes, in case we need it later...
                m_excludedResultPrefixes.push_back(
                        NamespacesVectorType::value_type(
                            theConstructionContext.getPooledString(thePrefix),
                            theConstructionContext.getPooledString(theURI)));

                // It's excluded, so remove it...
                i = m_namespaceDeclarations.erase(i);
            }
            else
            {
                ++i;
            }
        }
    }
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:42,代码来源:NamespacesHandler.cpp

示例12: AVTPart

XALAN_CPP_NAMESPACE_BEGIN



/**
 * Simple string part of a complex AVT.
 */
AVTPartSimple::AVTPartSimple(
            StylesheetConstructionContext&  constructionContext,
            const XalanDOMChar*             val,
            XalanDOMString::size_type       len) :
    AVTPart(),
    m_val(constructionContext.allocateXalanDOMCharVector(val, len, false)),
    m_len(len)
{
}
开发者ID:apache,项目名称:xalan-c,代码行数:16,代码来源:AVTPartSimple.cpp

示例13:

ElemLiteralResult::ElemLiteralResult(
			StylesheetConstructionContext&	constructionContext,
			Stylesheet&						stylesheetTree,
			const XalanDOMChar*				name,
			const AttributeListType&		atts,
			int								lineNumber,
			int								columnNumber,
			int								xslToken) :
	ElemUse(constructionContext,
			stylesheetTree,
			lineNumber,
			columnNumber,
			xslToken),
	m_elementName(constructionContext.getPooledString(name)),
	m_avts(0),
	m_avtsCount(0)
{
	init(constructionContext, stylesheetTree, name, atts);
}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例14: theGuard

void
NamespacesHandler::createResultAttributeNames(StylesheetConstructionContext&    theConstructionContext)
{
    // Go through all of the result namespaces and create the attribute
    // name that will be used when they're written to the result tree.
    // This is more efficient if the stylesheet is used multiple times.
    if (m_namespaceDeclarations.empty() == false)
    {
        const NamespaceExtendedVectorType::iterator theEnd =
                m_namespaceDeclarations.end();

        NamespaceExtendedVectorType::iterator       i =
                m_namespaceDeclarations.begin();

        StylesheetConstructionContext::GetAndReleaseCachedString theGuard(theConstructionContext);
        XalanDOMString& theName = theGuard.get();

        for(; i != theEnd; ++i)
        {
            NamespaceExtended&      theNamespace = *i;

            const XalanDOMString&   thePrefix = theNamespace.getPrefix();

            if (isEmpty(thePrefix) == false)
            {
                // Create a name of the form xmlns:prefix, where "prefix" is the
                // text of the prefix.
                // Reserve the appropriate amount of space in the string.
                reserve(theName, DOMServices::s_XMLNamespaceWithSeparatorLength + length(thePrefix) + 1);

                theName = DOMServices::s_XMLNamespaceWithSeparator;
                theName += thePrefix;

                theNamespace.setResultAttributeName(theConstructionContext.getPooledString(theName));
            }
            else
            {
                // It's the default namespace...
                theNamespace.setResultAttributeName(DOMServices::s_XMLNamespace);
            }
        }
    }
}
开发者ID:rherardi,项目名称:xml-xalan-c-src_1_10_0,代码行数:43,代码来源:NamespacesHandler.cpp

示例15: ElemUse

XALAN_CPP_NAMESPACE_BEGIN



ElemLiteralResult::ElemLiteralResult(
			StylesheetConstructionContext&	constructionContext,
			Stylesheet&						stylesheetTree,
			const XalanDOMChar*				name,
			const AttributeListType&		atts,
			int								lineNumber,
			int								columnNumber) :
	ElemUse(constructionContext,
			stylesheetTree,
			lineNumber,
			columnNumber,
			StylesheetConstructionContext::ELEMNAME_LITERAL_RESULT),
	m_elementName(constructionContext.getPooledString(name)),
	m_avts(0),
	m_avtsCount(0)
{
	init(constructionContext, stylesheetTree, name, atts);
}
开发者ID:,项目名称:,代码行数:22,代码来源:


注:本文中的StylesheetConstructionContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。