org.tm4j.topicmap.utils.XTMWriter .getResourceID(org.tm4j.topicmap.TopicMapObject tmo,org.tm4j.net.Locator srcLoc)

Description

Returns the fragment part of tmo's resourceLocator property if, and only if the document part of the resourceLocator matches the doucment part of the containing TopicMap object's resourceLocator property. This method is used to roundtrip id attribute values which were read in from an XTM file. If a Topic object is passed to this method and it has a resourceLocator property with a document part which does not match the document part of the containing TopicMap's resourceLocator property, then this method will check all of the subjectIndicators of the topic to see if there is one which does - in this case the fragment identifier of that subjectIndicator is returned.

Parameters
org.tm4j.net.Locator srcLoc
org.tm4j.topicmap.TopicMapObject tmo the TopicMapObject to extract a resource ID from

Returns

the value which can be assigned to the id attribute of the element exported for tmo or null if either the object or its container TopicMap does not have a resourceLocator specified or if the resourceLocator of the object or the containing TopicMap is not a URILocator instance.

Other Resources

Related Topics