Home › Forums › DITA and XMetaL Discussion › Publish of ditamap changes topicref href=…xml scope="external" to href=…html › Reply To: Publish of ditamap changes topicref href=…xml scope="external" to href=…html
Reply to: Publish of ditamap changes topicref href=…xml scope="external" to href=…html
July 9, 2011 at 12:26 amOK, I see the issue. The code that the DITA OT uses to generate the TOC file is what is putting in the link that you don't want and it appears to be due to lack of any special handling when it encounters a link to a *.xml filetype inside a
If you modify the href value and the filename so that it is “example-txt-file.txt” this should become a little more clear. It handles it properly in this case, so the confusion would seem to be simply the *xml file extension. If you really need the DITA OT to support this scenario I would suggest you submit a defect here describing the issue: http://sourceforge.net/tracker/?group_id=132728&atid=725074
You would also need to contend with what will happen when the reader clicks on such a link in their browser (or whatever software they are using to view the HTML). Depending on the content in the XML file, in some cases the browser might render the XML itself (usually in the forum of a “node tree”, or perhaps as the XML source), in some browsers it might complain there is no DTD (if you include a DOCTYPE), or it might attempt to pass the file to another application to open it. I'm not sure what you would expect. If the intention is to allow people to copy the XML for use elsewhere what will end up on the clipboard may also differ depending on how it is being rendered.
It might be more predictable to link to another file type that contains the same XML content. Perhaps TXT is sufficient for your purpose (if that is merely to allow someone to view the content of the file)? What a web browser does in that case (when it encounters a file with a TXT extension) may also differ from browser to browser.
You might try these options as well:
Move the link into a DITA topic
1) Create a
2) Inside the DITA topic include an
Include the source of the XML inside a topic
1) Create a
2) Inside the topic include the full text of the XML document. You may include this inside various elements intended for this purpose, perhaps
Example of what the DITA source XML might look like:
[code]
The DITA OT generates this when producing HTML from the DITA above:
[code]
<?xml version="1.0"?>
<!DOCTYPE foo PUBLIC "-//ORG//MY DOCTYPE//EN" "schemaname.dtd">
<foo>
<bar/>
<baz/>
</foo>
[/code]
…which ends up looking like this in a browser after all the entities have been interpreted: