How to create an URI?

Hello

The DOM guide https://collada.org/mediawiki/index.php/DOM_guide:_Resolving_URIs#Creating_URI_Strings suggests calling setElement(*target) and subsequently resolveURI() for creating an URI address. However, the first method has been removed from the class
The revision commentary called the method ‘mostly useless’, which I find odd, because there is no apparent alternative except explicit string concatenation by the developer, which kinda defeats the purpose of having a daeURI class. Am I missing something?

The workaroung I am currently using looks like this:


//Material is a domPhysics_material*, Location is a daeElement*
domInstance_physics_material* ipm = daeSafeCast<domInstance_physics_material>(Location->add("instance_physics_material"));
daeURI url(*(Location->getDocumentURI()),std::string("#").append(Material->getId()));
if (ipm->getDocument() == Material->getDocument()){
ipm->setUrl(url);
} else {
ipm->setAttribute("url",url.getURI());
}

Is there a more elegant way?

In any case, the guide should be updated.

Sourceforge is the place to report things to the COLLADA DOM project tracker.