On 05/23/2012 05:31 PM, Orahood, Andy wrote:
> We are transforming 17,000 documents. They are all topics, and all the topics
> have the same id of "kbdoc". What happens after transformation is the related
> information links at the bottom of the page all display the title of one
> particular document even though the links themselves go to the correct
> documents as provided in the<related-links> section of the source. So the
> related links for all the rendered documents look like this:
>
> Related Information
> * Title of document xxx
> * Title of document xxx
> * Title of document xxx
>
> Again, none of the links actually go to document xxx; they go to their
> correct documents. The links themselves have "#kbdoc-999" appended to them,
> which makes me think that ditac is only able to handle up to 999 topics with
> the same id, and additionally makes me wonder if this is related to the
> related-links title problem. To test this theory I transformed a subset of
> documents, less than 999, and the problem disappeared: the titles of the
> related links were correct. Could there be a link between the way ditac
> appends a unique number to identify ids shared by more than one document and
> the way it caches the titles of related links that would cause problems if
> you have more than 999 documents sharing the same topic id?
>
Yes.
For navigation purposes, ditac must ensure that some elements (i.e.
topics) are given unique IDs and this, no matter what the author has
specified in her/his DITA source file.
Therefore you'll find this function in PreProcessor.java:
---
protected static String setUniqueId(Element element, String id,
Map<String, Element> idToElement) {
String id2 = id;
int counter = 2;
Element e;
while ((e = idToElement.get(id2)) != null && e != element) {
if (counter >= 1000) {
break;
}
StringBuilder buffer = new StringBuilder(id);
buffer.append('-');
buffer.append(Integer.toString(counter++));
id2 = buffer.toString();
}
element.setAttributeNS(null, "id", id2);
idToElement.put(id2, element);
return id2;
}
---
Changing 1000 to 100000 is a quick and dirty fix for this problem.
Needless to say that we'll cleanly fix this bug in the next release of
ditac.
--
XMLmind DITA Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/ditac-support