Stream: implementers
Topic: Implementing custom XHTML in Section->text->div elements
Jake Hardy (Feb 22 2019 at 14:22):
I've been trying to implement a Section->text->div element which gives an XHTML representation of my generated FHIR plans. When validating the plans, I get XML errors, even though the plan should be validating the div element as XHTML. One thing I've noticed is that the converter appears to remove the text "html" from my "<html ...>" tags. Has anybody else dealt with this?
Lloyd McKenzie (Feb 22 2019 at 15:35):
Why would you have a <html/> tag? Narrative starts with <div/> If you're using an editor that produces a full XHTML page, you'll need to extract the body element and turn it into a <div/> element. Also, make sure you strip out all of the elements that FHIR prohibits - we don't allow any active content.
Jake Hardy (Feb 22 2019 at 15:48):
I'll try that, thanks!
Eric Haas (Feb 23 2019 at 00:52):
here is how I look at it
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Enter your title here</title> </head> <body> <!-- extract the body element and turn it into a <div/> element. --> <h1>Everything in here</h1> <p>gos into the text.div wrapped in a div</p> </body> <!-- extract the body element and turn it into a <div/> element. --> </html>
Lloyd McKenzie (Feb 23 2019 at 02:11):
Except that "everything" includes a filter that strips out all of the elements and attributes not allowed because of their potential to convey active content.
Grahame Grieve (Feb 23 2019 at 02:18):
and also entities not allowed (html allows lots of entity references that xhtml doesn't)
Last updated: Apr 12 2022 at 19:14 UTC