From: Conal T. <co...@pa...> - 2004-09-27 08:03:14
|
Kal Ahmed wrote: > I'll have to look into why the xml:base attribute is not affecting the > base locator of the topic map (I have a suspicion that it is > to do with > the way that the SerializedTopicMapSource works). That's definitely the case. I was looking at the source code just an hour ago, and it was certainly the case then :-) The SerializedTopicMapSource constructor which I used was passed a single java.io.File. It converts this to a url in a String variable, and in populateTopicMap it makes it into a locator, and in readMap it passes the locator to the builder.build method. My guess is that the builder should over-ride this supplied base-locator if it finds another one in the XTM stream itself (in the form of an xml:base attribute). > What you suggest > (adding a base attribute to the <import> element) is a good idea as a > workaround. OK. I might do that. > Another possible workaround is to make use of a catalog file. TM4J > supports redirection through a catalog, so you can specify that the > filesystem location for topic map http://foo.xtm is > /path/to/xtmfile.xtm. The http:// URI will be used as the topic maps > base locator even thought the topic map is read from the local > filesystem. Actually this sounds like a neat trick too :-) Thanks heaps! > So there are a lot of options, but I agree that we should fix the > xml:base processing for the simple case where a > SerializedTopicMapSource > reads a single XTM file. Cheers Con |