-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Success!  Thank you!

I'm guessing now that holding the handle is a general rule for the API? Is there an easy way to tell for any call if a reference gets retained?

Thanks,
    Paul

On 8-Sep-06, at 4:29 PM, David Bertoni wrote:

Paul Lalonde wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi. I'm tring to use Xalan's XPath support to run queries on some Collada documents I have. I've run into the issue that the documents all declare themselves in an anonymous namespace:
    <?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema"; version="1.4.0">
        <asset>
        ...
        </asset>
    </COLLADA>
So I want my XPath expressions to refer through that namespace. I thought I'd try using the XalanSimplePrefixResolver doing something like this:
        XalanSimplePrefixResolver thePrefixResolver(
                                  XalanDOMString("c"),
XalanDOMString("http:// www.collada.org/2005/11/COLLADASchema"), XalanDOMString("http:// www.collada.org/2005/11/COLLADASchema")
                                  );

XalanSimplePrefixResolver holds references to existing XalanDOMString instances, and you are passing in temporaries that are destroyed after the constructor is called. As a result, the instance contains references to three XalanDOMString instances that have already been destroyed. When the XPath compiler attempts to use the PrefixResolver, it contains garbage data.

Declare the XalanDOMString instances on the stack, not as temporaries, and your code will work.

Dave


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFAgDCr7+oA6AsvAkRAupnAJ4sarK02tW85Gjxy/r4PNcP9Yg6xACgvDV6
Yup3Nn9N2ud7DbEZoF+sCGE=
=zUQk
-----END PGP SIGNATURE-----

Reply via email to