Hi,
When diving deeper into our custom variable resolver, we found an issue with resolving of nested conrefs (which affects our custom variable resolver which can have nested variables or nested conrefs).
Below an example case with standard DITA files (not from our repository, nor customized) and standard Oxygen XML Author to explain the issue:
We have a topic with a ph element that has some text inside the element (simple_topic.dita ->
<ph conref="…">Text content inside ph element that has the conref attribute.</ph>)
This ph element has a conref attribute to a ph inside conref_niv_1.dita.
This ph element in conref_niv_1.dita, contains another ph with a conref to conref_niv_2.dita.
The example topics at the end of the e-mail (and attached) make it more clear.
The issue is that with every refresh of the references (Oxygen menu: DITA -> Refresh references), a character is removed from the text content of the ph element in simple_topic.dita, change the content of this topic…
We noted this when improving our custom ‘variable’ resolving which is based on the Oxygen DITAConRefResolver (package ro.sync.ecss.extensions.dita.conref -> DITAConRefResolver.java).
We do an override of:
public SAXSource resolveReference(
AuthorNode node,
String systemID,
AuthorAccess authorAccess,
EntityResolver entityResolver)
And while debugging, we notice that in the incoming AuthorNode parameter (node) this character is already removed. This can be seen when:
if (node instanceof AuthorElement) {
AuthorElement element = (AuthorElement) node;
….
AuthorDocumentController documentController = authorAccess.getDocumentController();
AuthorDocumentFragment fragFromNode = documentController.createDocumentFragment(element,
true);
xml = documentController.serializeFragmentToXML(fragFromNode);
…
We found this for Oxygen 19.1, we can also reproduced on Oxygen 17.1
Kind regards,
Pascal
Example topics:
simple_topic.dita
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic
id="simple_topic">
<title>Simple
Topic</title>
<body>
<p><ph
conref="conref_niv_1.dita#conref_niv_1/id_conref_niv_1">Text
content inside ph element that has the conref attribute.</ph></p>
</body>
</topic>
conref_niv_1.dita
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic
id="conref_niv_1">
<title>Conref
niv 1</title>
<body>
<p><ph
id="id_conref_niv_1">Content
from conref_niv_1, followed by nested conref from niv 2:
<ph
conref="conref_niv_2.dita#conref_niv_2/id_conref_niv_2"/></ph></p>
</body>
</topic>
conref_niv_2.dita
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic
id="conref_niv_2">
<title>conref
niv 2</title>
<body>
<p><ph
id="id_conref_niv_2">Content
from conref_niv_2 </ph></p>
</body>
</topic>
|