{"action":"created","issue":{"url":"https://api.github.com/repos/dita-community/org.dita-community.common.xslt/issues/12","labels_url":"https://api.github.com/repos/dita-community/org.dita-community.common.xslt/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/dita-community/org.dita-community.common.xslt/issues/12/comments","events_url":"https://api.github.com/repos/dita-community/org.dita-community.common.xslt/issues/12/events","html_url":"https://github.com/dita-community/org.dita-community.common.xslt/issues/12","id":94406187,"number":12,"title":"Resolve topicref URI is not working when @chunk=''to-content\" is specified","user":{"login":"naguila","id":10234139,"avatar_url":"https://avatars.githubusercontent.com/u/10234139?v=3","gravatar_id":"","url":"https://api.github.com/users/naguila","html_url":"https://github.com/naguila","followers_url":"https://api.github.com/users/naguila/followers","following_url":"https://api.github.com/users/naguila/following{/other_user}","gists_url":"https://api.github.com/users/naguila/gists{/gist_id}","starred_url":"https://api.github.com/users/naguila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naguila/subscriptions","organizations_url":"https://api.github.com/users/naguila/orgs","repos_url":"https://api.github.com/users/naguila/repos","events_url":"https://api.github.com/users/naguila/events{/privacy}","received_events_url":"https://api.github.com/users/naguila/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dita-community/org.dita-community.common.xslt/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"drmacro","id":1004229,"avatar_url":"https://avatars.githubusercontent.com/u/1004229?v=3","gravatar_id":"","url":"https://api.github.com/users/drmacro","html_url":"https://github.com/drmacro","followers_url":"https://api.github.com/users/drmacro/followers","following_url":"https://api.github.com/users/drmacro/following{/other_user}","gists_url":"https://api.github.com/users/drmacro/gists{/gist_id}","starred_url":"https://api.github.com/users/drmacro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drmacro/subscriptions","organizations_url":"https://api.github.com/users/drmacro/orgs","repos_url":"https://api.github.com/users/drmacro/repos","events_url":"https://api.github.com/users/drmacro/events{/privacy}","received_events_url":"https://api.github.com/users/drmacro/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-07-10T22:34:57Z","updated_at":"2015-07-14T17:04:20Z","closed_at":null,"body":"When topics are being reused several times in a given book and chunk is specified as \"to-content\", the transformation fails to resolve the correct topic URI using the function df:resolveTopicRef(). If the chunk attribute is specified as \"to-content select-branch\", the transformation finish correctly.\r\n\r\nThis scenario is present when using dc-preprocess and adjust-copy is enabled to automatically generate @copy-to for reused topics. The resolved URI points to the @copy-to  when should be to the ancestor with @chunk.\r\n\r\nSupport for \"to-content\" is needed.\r\n\r\nbookmap example:\r\n\r\n```xml\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE bookmap PUBLIC \"-//OASIS//DTD DITA BookMap//EN\" \"bookmap.dtd\">\r\n<bookmap>\r\n    <booktitle>\r\n        <mainbooktitle></mainbooktitle>\r\n    </booktitle>\r\n    <chapter chunk=\"to-content\" href=\"topics/topic1.dita\">\r\n        <topicref href=\"topics/topic3.dita\"/>\r\n    </chapter>\r\n    <chapter chunk=\"to-content\" href=\"topics/topic2.dita\">\r\n        <topicref href=\"topics/topic3.dita\"/>\r\n    </chapter>\r\n</bookmap>\r\n```"},"comment":{"url":"https://api.github.com/repos/dita-community/org.dita-community.common.xslt/issues/comments/121309734","html_url":"https://github.com/dita-community/org.dita-community.common.xslt/issues/12#issuecomment-121309734","issue_url":"https://api.github.com/repos/dita-community/org.dita-community.common.xslt/issues/12","id":121309734,"user":{"login":"naguila","id":10234139,"avatar_url":"https://avatars.githubusercontent.com/u/10234139?v=3","gravatar_id":"","url":"https://api.github.com/users/naguila","html_url":"https://github.com/naguila","followers_url":"https://api.github.com/users/naguila/followers","following_url":"https://api.github.com/users/naguila/following{/other_user}","gists_url":"https://api.github.com/users/naguila/gists{/gist_id}","starred_url":"https://api.github.com/users/naguila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naguila/subscriptions","organizations_url":"https://api.github.com/users/naguila/orgs","repos_url":"https://api.github.com/users/naguila/repos","events_url":"https://api.github.com/users/naguila/events{/privacy}","received_events_url":"https://api.github.com/users/naguila/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T17:04:20Z","updated_at":"2015-07-14T17:04:20Z","body":"Calling df:resolveTopicRef() function in custom templates raise the error. I could trace it to the df:inChunk() function as you mention."}}