Page 1 of 1

Link button behavior (xref)

Posted: Fri Feb 15, 2013 5:20 am
by jimp
On one PC I have, when I press the link button and click xref, it does what I want and pops in an xref tag and it's ready for me to fill in the linkend paramter. This is what I want.

On my laptop, however, when I press link, then "Cross Reference (xref)" it pops up a dialog that wants me to pick a file and doesn't show anything no matter which file I click.

Is there a way to change that so it goes back to the other method, just putting in the xref and letting me fill in the linkend attribute on my own? Both of these were running 14.1, I just updated the laptop to 14.2 and it still does the same thing.

The text on the options under the Link button is different on both PCs, so I figured it must be something to do with the project type, options, etc, but I haven't managed to track down the magic yet. I find myself having to switch over to text mode so I can type in the xref tag manually.

I'm probably overlooking something fairly simple, but I've Googled around a bit and searched the help, options and so on but came up empty. I may just be using the wrong search terms.

Any pointers would be appreciated, thanks!

Re: Link button behavior (xref)

Posted: Fri Feb 15, 2013 11:41 am
by Radu
Hi,

First of all some questions:
You are a Docbook user, right?

I think that in fact the PC has Oxygen 14.0 installed which indeed when the button to insert an xref was pressed it just inserted an empty xref element.
We did not consider this a very useful way of helping the user, it was equivalent to inserting the element using the content completion window.

In Oxygen 14.1 (and newer) the action was redesigned to be more useful, to show a dialog in which when you choose a target file (which can be the edited file) a list of gathered IDs is shown together with a preview of each target element, allowing you to choose the target ID from the list.
But I do not understand why this does not work for you, could you answer some questions?

Are you editing Docbook 4 or 5?
Are your Docbook XML files based on DTD, XML Schema or RelaxNG grammars?
Do you use XIncludes to merge multiple documents or entity references?

You can always get the old behavior by pressing enter in the Author mode and choosing "xref" from the list of content completion elements or by using the Elements View.

Regards,
Radu

Re: Link button behavior (xref)

Posted: Sat Feb 16, 2013 3:17 am
by jimp
The project is in DocBook 4, but the files aren't included with xinclude. Rather, it's done using entities. For example, in the "master file" it looks like:

Code: Select all


<!ENTITY __something__ SYSTEM "something.xml">
Some other text
&__something__;
I don't recall the specifics of why it was setup that way (I didn't create this one myself), but I imagine a better method would probably be welcomed. :-)

Pressing enter and putting in xref that way is certainly a good workaround. I'm not sure why that never occurred to me. Thanks!

Re: Link button behavior (xref)

Posted: Mon Feb 18, 2013 9:50 am
by Radu
Hi Jim,

Thanks for the details.
Probably in the new dialog used to insert the linkend you chose a module as a target and because the module did not have the DOCTYPE in it, IDs defined in it were not collected as viable targets.
We'll see if we can improve on this use case.

In the meantime, in the dialog used to select IDs you can select directly the master XML document (which includes everything).

Regards,
Radu

Re: Link button behavior (xref)

Posted: Sat Feb 23, 2013 9:55 pm
by jimp
I finally tracked this down. They both did have the current version, but the one that still had the old behavior was using a custom Docbook 4 DTA that had a copy of the older action/menu/toolbar in it that still referred to insert.xref (Using SurroundWithFragmentOperation) rather than insert.cross.reference.xref (Using InsertXrefOperation)

I was able to use both the old and the new behavior together by adding a similar action/menu/toolbar entry to my laptop and now I'm happy all around. I can use the old and the new, whichever I feel like doing at the time. :D

The custom DTA also explained a few other differences in behavior that I was seeing and reviewing both side-by-side allowed me to get them to behave similarly.

Thanks for the pointers!