FHIR Chat · Quotes not being escaped · IG creation

Stream: IG creation

Topic: Quotes not being escaped


view this post on Zulip Ole Hedegaard (Feb 18 2019 at 12:17):

Hi,

I'm about to publish an implementation guide, in which I supply XML examples. These show up in the generated html (Profile -> Examples -> XML tab). So far so good. Each example is enriched with a narrative when I run the IG publisher. However, the generated JSON example turns out invalid because the namespace quotes are not escaped. Here's an example:

<Communication xmlns="http://hl7.org/fhir">
<id value="123"/>
<meta>
<profile value="http://mycompany.com/message"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p>...</div>
</text>...

  • which causes this JSON example:

{
"resourceType" : "Communication",
"id" : "123",
"meta" : {
"profile" : [
"http://mycompany.com/message"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns="http://www.w3.org/1999/xhtml">...</div>"
}...

As you can see, the quotes surrounding the www.w3.org... namespace are not escaped in the JSON example, and thereby the example is not valid. Any input on how to fix this?

Thanks,
Ole Hedegaard

view this post on Zulip Lloyd McKenzie (Feb 18 2019 at 15:57):

Please submit a change request

view this post on Zulip Eric Haas (Feb 18 2019 at 17:22):

The problem is more subtle. The * displayed* json in [SD].json.html will not show the escapes since they are read as escapes - but download the artifact and you will see something like:

{
  "resourceType": "StructureDefinition",
  "id": "extension-blah",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;\"><tr style=\"border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;\"><th style=\"vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"http://build.fhir.org/formats.html#table\" title=\"The logical name of the element\">Name</a></th><th style=\"vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><a href=\"http://build.fhir.org/formats.html#table\" title=\"Information about the use of the element\">Flags</a></th><th

view this post on Zulip Jens Villadsen (Feb 19 2019 at 14:55):

well its an issue that they are not escaped. The fact that you can download working examples is great - but the rendering should be fixed as well

view this post on Zulip Lloyd McKenzie (Feb 19 2019 at 15:11):

Can you submit a change request?

view this post on Zulip Jens Villadsen (Feb 20 2019 at 21:47):

https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=20413

view this post on Zulip Jens Villadsen (Feb 20 2019 at 21:48):

or did you mean an PR on github?

view this post on Zulip Grahame Grieve (Feb 20 2019 at 21:49):

no a gforge ticket is right


Last updated: Apr 12 2022 at 19:14 UTC