logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: XalanNamespacesStack::PrefixResolverProxy persistence: msg#00015

Subject: Re: XalanNamespacesStack::PrefixResolverProxy persistence
Paul Lalonde wrote:
Do I have to build a new XalanNamespacesStack::PrefixResolverProxy every time the NamespacesStack changes, or does it remain synchronized?

If you look at the source code, you'll see that PrefixResolverProxy only calls into the XalanNamespacesStack instance, so there's no need to synchronize anything:

const XalanDOMString*
XalanNamespacesStack::PrefixResolverProxy::getNamespaceForPrefix(const XalanDOMString& prefix) const
{
        return m_stack.getNamespaceForPrefix(prefix);
}


However, you should be careful when using this class, as prefix bindings will go in and out of scope when the stack is pushed and popped. When bindings go out of scope, the pointer returned from PrefixResolverProxy::getNamespaceForPrefix will point to an object that has been destroyed.

You didn't provide enough information about how you are using this class to figure out if this will be a problem or not.

Dave



<Prev in Thread] Current Thread [Next in Thread>