private void processAttributes(XhtmlNode xn, IXMLWriter xml, String... names) throws IOException { for (String n : names) { if (xn.hasAttribute(n)) { String v = xn.getAttribute(n); if (n.equals("id")) xml.attribute("ID", v); else xml.attribute(n, v); } } }
for (String an : node.getAttributes().keySet()) { if (an.equals("xmlns")) { result.def(node.getAttribute(an)); nsattrs.add(an); result.ns(an.substring(6), node.getAttribute(an)); nsattrs.add(an);
for (String an : node.getAttributes().keySet()) { if (an.equals("xmlns")) { result.def(node.getAttribute(an)); nsattrs.add(an); result.ns(an.substring(6), node.getAttribute(an)); nsattrs.add(an);
private void processRenderMultiMedia(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { String v = n.getAttribute("src"); xml.attribute("referencedObject", v); processAttributes(n, xml, "id", "language", "styleCode"); xml.enter("renderMultiMedia"); processChildren(xml, n); xml.exit("renderMultiMedia"); }
private void processlinkHtml(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { String v = n.getAttribute("src"); xml.attribute("referencedObject", v); processAttributes(n, xml, "name", "href", "rel", "rev", "title", "id", "language", "styleCode"); xml.enter("linkHtml"); processChildren(xml, n); xml.exit("linkHtml"); }
else if (c.getNodeType() == NodeType.Element) { if (c.getName().equals("a")) { list.add(new Piece(c.getAttribute("href"), c.allText(), c.getAttribute("title"))); } else if (c.getName().equals("b") || c.getName().equals("em") || c.getName().equals("strong")) { list.add(new Piece(null, c.allText(), null).setStyle("font-face: bold"));
private void validateResourceRules(List<ValidationMessage> errors, Element element, NodeStack stack) { String lang = element.getNamedChildValue("language"); Element text = element.getNamedChild("text"); if (text != null) { Element div = text.getNamedChild("div"); if (lang != null && div != null) { XhtmlNode xhtml = div.getXhtml(); String xl = xhtml.getAttribute("lang"); if (xl == null) { warning(errors, IssueType.BUSINESSRULE, div.line(), div.col(), stack.getLiteralPath(), false, "Resource has a language, but the XHTML does not have a language tag"); } else if (!xl.equals(lang)) { warning(errors, IssueType.BUSINESSRULE, div.line(), div.col(), stack.getLiteralPath(), false, "Resource has a language ("+lang+"), and the XHTML has a language ("+xl+"), but they differ "); } } } }
private void processAttributes(XhtmlNode xn, IXMLWriter xml, String... names) throws IOException { for (String n : names) { if (xn.hasAttribute(n)) { String v = xn.getAttribute(n); if (n.equals("id")) xml.attribute("ID", v); else xml.attribute(n, v); } } }
private void processlinkHtml(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { String v = n.getAttribute("src"); xml.attribute("referencedObject", v); processAttributes(n, xml, "name", "href", "rel", "rev", "title", "id", "language", "styleCode"); xml.enter("linkHtml"); processChildren(xml, n); xml.exit("linkHtml"); }
private void processRenderMultiMedia(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { String v = n.getAttribute("src"); xml.attribute("referencedObject", v); processAttributes(n, xml, "id", "language", "styleCode"); xml.enter("renderMultiMedia"); processChildren(xml, n); xml.exit("renderMultiMedia"); }
else if (c.getNodeType() == NodeType.Element) { if (c.getName().equals("a")) { list.add(new Piece(c.getAttribute("href"), c.allText(), c.getAttribute("title"))); } else if (c.getName().equals("b") || c.getName().equals("em") || c.getName().equals("strong")) { list.add(new Piece(null, c.allText(), null).setStyle("font-face: bold"));
private void validateResourceRules(List<ValidationMessage> errors, Element element, NodeStack stack) { String lang = element.getNamedChildValue("language"); Element text = element.getNamedChild("text"); if (text != null) { Element div = text.getNamedChild("div"); if (lang != null && div != null) { XhtmlNode xhtml = div.getXhtml(); String xl = xhtml.getAttribute("lang"); if (xl == null) { warning(errors, IssueType.BUSINESSRULE, div.line(), div.col(), stack.getLiteralPath(), false, "Resource has a language, but the XHTML does not have a language tag"); } else if (!xl.equals(lang)) { warning(errors, IssueType.BUSINESSRULE, div.line(), div.col(), stack.getLiteralPath(), false, "Resource has a language ("+lang+"), and the XHTML has a language ("+xl+"), but they differ "); } } } }