FHIR Chat · Resource has a language, but XHTML does not have a lang tag · IG creation

Stream: IG creation

Topic: Resource has a language, but XHTML does not have a lang tag


view this post on Zulip Jose Costa Teixeira (Feb 11 2020 at 17:25):

How to fix this warning? Do I need to put a lang="..." in every narrative field of every resource? or is there a good way to handle this? I'm not sure what is missing

view this post on Zulip Grahame Grieve (Feb 11 2020 at 19:53):

yes in the narrative yes

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 03:31):

OK I see it.
Question: is that a warning? isn't that too harsh? My source resources do not have narrative, so I will have this for every resource with a language.

view this post on Zulip Grahame Grieve (Feb 12 2020 at 03:34):

oh - it's generated narrative? that's pretty poor on my part then...

view this post on Zulip Grahame Grieve (Feb 12 2020 at 03:34):

no:

    if (r.hasLanguage()) {
      x.setAttribute("xml:lang", r.getLanguage());
    }

view this post on Zulip Grahame Grieve (Feb 12 2020 at 03:35):

so I'm not sure what you need to do

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 03:57):

from what I see, it sets xml:lang but the qa checks for lang.

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 03:58):

i just changed one of my lang to xml:lang and it is broken again

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 04:00):

which one is right?

    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"nl-BE\"><p><b>Generated Narrative with Details</b>

or

    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"nl-BE\"><p><b>Generated Narrative with Details</b>

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 04:01):

the second does not give me a warning

view this post on Zulip Grahame Grieve (Feb 12 2020 at 04:12):

it's a SHOULD in the spec, so it's a warning. I will update the code to generate lang not xml:lang

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 04:24):

thanks

view this post on Zulip Grahame Grieve (Feb 12 2020 at 06:32):

https://www.w3.org/TR/i18n-html-tech-lang/#langvalues

view this post on Zulip Grahame Grieve (Feb 12 2020 at 06:33):

seems more complicated

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 06:35):

says that for xhtml we have to use both lang and xml:lang

view this post on Zulip Jose Costa Teixeira (Feb 12 2020 at 06:37):

what should the QA check for? xml:lang, lang, or both?
At this moment it seems that the generation code is inconsistent with the qa check, which i'd fix first if possible

view this post on Zulip Grahame Grieve (Feb 12 2020 at 06:51):

both. in both cases

view this post on Zulip Jose Costa Teixeira (Feb 13 2020 at 02:36):

Check is now OK against lang and xml:lang, but generated narrative doesn't add either

view this post on Zulip Grahame Grieve (Feb 13 2020 at 02:45):

how to reproduce? because the code sure thinks it is adding both

view this post on Zulip Jose Costa Teixeira (Feb 13 2020 at 02:49):

in the ci build now

view this post on Zulip Jose Costa Teixeira (Feb 13 2020 at 02:49):

http://build.fhir.org/ig/hl7-be/be-core/branches/master/qa.html

view this post on Zulip Grahame Grieve (Feb 13 2020 at 03:08):

so that's not generated narrative; it only looks like it. It's actually narrative that you provided manually, so the ig publisher doesn't replace it

view this post on Zulip Jose Costa Teixeira (Feb 13 2020 at 03:30):

indeed one of the examples had some narrative that I pasted there (just removed it). But the others don't have narrative and are having the same issue.
https://github.com/hl7-be/be-core/tree/master/input/examples/Communication

view this post on Zulip Jose Costa Teixeira (Feb 13 2020 at 03:30):

what am I missing?

view this post on Zulip Grahame Grieve (Feb 13 2020 at 06:00):

found it. fixed next release

view this post on Zulip François Macary (Feb 13 2020 at 14:15):

I wonder if your @Grahame Grieve latest fix has a bad effect on my own IG. The warning below appeared with this latest release:
Resource has a language, but the XHTML does not have an xml:lang tag (needs both lang and xml:lang - see https://www.w3.org/TR/i18n-html-tech-lang/#langvalues)
Which is fine, from what is explained above in this stream. However, the warning persists also after adding xml:lang.
My narrative is like this:
<text>
<status value="additional"/>
<div xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-FR" lang="fr-FR">
<p>codage affiné et conditions d'application du dosage de la vitamine D - Nomenclature des Actes de Biologie Médicale</p>
</div>
</text>
So why do I still get the warning?

view this post on Zulip Jose Costa Teixeira (Feb 13 2020 at 14:54):

Indeed. I just tested and I confirm: I manually added an additional narrative to one of my resources and suddenly I now have the same warning.

view this post on Zulip Grahame Grieve (Feb 13 2020 at 22:00):

fixed next release

view this post on Zulip François Macary (Feb 20 2020 at 08:13):

:+1:


Last updated: Apr 12 2022 at 19:14 UTC