[oXygen-sdk] DITA: 'Refresh references' of a topic with nested conrefs, removes the first character of the text content of this element (node) with the conref attribute

Oxygen XML Editor Support (Radu Coravu) support at oxygenxml.com
Thu Mar 1 01:03:15 CST 2018


Hi Pascal,

Thanks for the samples, I reproduced the problem and I'll start working 
on it. We'll try to have a fix for this in Oxygen 20.0 (April this year).

Regards,
Radu

Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

On 2/28/2018 9:51 AM, Pascal Beutels wrote:
> 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:
>
>   * getting the text of all the content nodes using
>      node.getTextContent(), there the first character is already gone.
>   * converting the node to an AuthorElement (which it is) and creating
>     an AuthorDocumentFragment from it and then serialize it using
>     AuthorDocumentController.serializeFragmentToXML, the text content of
>     that element is also already stripped.
>     Code sample/snippet:
>
> if (node instanceof AuthorElement) {
>
>                 AuthorElement element = (AuthorElement) node;
>
>                 ….
>
>                                     AuthorDocumentController
> documentController = authorAccess.getDocumentController();
>
>                                     AuthorDocumentFragment fragFromNode
> = documentController.createDocumentFragment(element, true);
>
>                                     xml =
> documentController.serializeFragmentToXML(fragFromNode);
>
>>
>   * using your suggested approach using a AuthorElementDomWrapper
>     created from this AuthorElement.
>
>
>
>
>
> 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">
> <topicid="simple_topic">
>     <title>Simple Topic</title>
>     <body>
>
> <p><phconref="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">
> <topicid="conref_niv_1">
>     <title>Conref niv 1</title>
>     <body>
>         <p><phid="id_conref_niv_1">Content from conref_niv_1, followed
> by nested conref from niv 2:
>
> <phconref="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">
> <topicid="conref_niv_2">
>     <title>conref niv 2</title>
>     <body>
>         <p><phid="id_conref_niv_2">Content from conref_niv_2 </ph></p>
>     </body>
> </topic>
>
>
>
>
>
>
>
> *www.sdl.com* <http://www.sdl.com/>
>
> SDL PLC confidential, all rights reserved. If you are not the intended
> recipient of this mail SDL requests and requires that you delete it
> without acting upon or copying any of its contents, and we further
> request that you advise us.
> ​SDL PLC is a public limited company registered in England and Wales.
> Registered number: 02675207.
> Registered address: SDL PLC, New Globe House, Vanwall Business
> Park, Vanwall Road, Maidenhead, SL6 4UB, U.K.
>
>
>
>
> _______________________________________________
> oXygen-sdk mailing list
> oXygen-sdk at oxygenxml.com
> https://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
>



More information about the oXygen-sdk mailing list