RWS/dxa-model-service

dxa.defaults.rich-text-xmlns-remove has no effect

Closed this issue · 6 comments

According to the DXA 2.0 Docs (https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v10/GUID-DDB87018-AE37-4624-A033-2483644B4C57), you can get the Model Service to leave the component URI in de xlink:href attribute when resolving the Rich Text field by setting a configuration setting in dxa.properties:

dxa.defaults.rich-text-xmlns-remove=false

I have set this property, and restarted the Model Service, but I still don't see the xlink:href in the JSON returned by the Model Service. Scanning the code in this repo, I don't see any reference to this property so I am guessing it has not been implemented?

Hi @willprice76
There is no any reference to the property because it is mapped to ConfigService using Spring Boot mechanism

You can find unit tests for this feature here

Are you sure that you set the property in the correct place?
Maybe dxa.defaults.rich-text-resolve is set to false?
Btw, on Trace level you can check what happens with the property:
log.trace("RichTextResolver, resolve = {}, remove = {}, input fragment: '{}'", ...)

Hi @azarakovskiy - I think the problem is that DXA doesn't use the xlink:href attribute in the rendered JSON, so there is nothing to remove, unless you are using some other JSON format (DD4T?). See https://tridion.stackexchange.com/a/18701/54

In which case the docs are a bit misleading... Or do I have this wrong?

@willprice76 that's correct that DXA doesn't use xlink:href attribute, so we don't even publish it. This feature in Model Service is only used for DD4T content.

Did the explanation from you solve your issue btw?

I will read the docs whether or they should be re-phrased.

@willprice76 decided to modify docs. They will say now that 'resolve' property enables or disables the whole processing, and 'remove' indicates whether to remove 'xlink' things from the content. Hope it is less confusing.

Clarified in DXA 2.0 documentation