- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.hl7.fhir.utilities.xhtml.XhtmlNode.getChildNodes()
方法的一些代码示例,展示了XhtmlNode.getChildNodes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XhtmlNode.getChildNodes()
方法的具体详情如下:
包路径:org.hl7.fhir.utilities.xhtml.XhtmlNode
类名称:XhtmlNode
方法名:getChildNodes
暂无
代码示例来源:origin: jamesagnew/hapi-fhir
public void compose(Element div, XhtmlNode x) {
for (XhtmlNode child : x.getChildNodes()) {
appendChild(div, child);
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void writeDocument(String indent, XhtmlNode node) throws IOException {
indent = "";
for (XhtmlNode c : node.getChildNodes())
writeNode(indent, c, false);
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void processChildren(IXMLWriter xml, XhtmlNode x) throws IOException, FHIRException {
for (XhtmlNode n : x.getChildNodes())
processChildNode(xml, n);
}
代码示例来源:origin: jamesagnew/hapi-fhir
private List<Piece> htmlFormattingToPieces(String html) throws IOException, FHIRException {
List<Piece> myPieces = new ArrayList<Piece>();
if (html.contains(("<"))) {
XhtmlNode node = new XhtmlParser().parseFragment("<p>"+html+"</p>");
for (XhtmlNode c : node.getChildNodes()) {
addNode(myPieces, c);
}
} else
myPieces.add(new Piece(null, html, null));
return myPieces;
}
private void addNode(List<Piece> list, XhtmlNode c) {
代码示例来源:origin: jamesagnew/hapi-fhir
private XhtmlNode parseNode(Element node, String defaultNS) throws FHIRFormatError {
XhtmlNode res = new XhtmlNode(NodeType.Element);
res.setName(node.getLocalName());
defaultNS = checkNS(res, node, defaultNS);
for (int i = 0; i < node.getAttributes().getLength(); i++) {
Attr attr = (Attr) node.getAttributes().item(i);
if (attributeIsOk(res.getName(), attr.getName(), attr.getValue()) && !attr.getLocalName().startsWith("xmlns"))
res.getAttributes().put(attr.getName(), attr.getValue());
}
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeType() == Node.TEXT_NODE) {
res.addText(child.getTextContent());
} else if (child.getNodeType() == Node.COMMENT_NODE) {
res.addComment(child.getTextContent());
} else if (child.getNodeType() == Node.ELEMENT_NODE) {
if (elementIsOk(child.getLocalName()))
res.getChildNodes().add(parseNode((Element) child, defaultNS));
} else
throw new FHIRFormatError("Unhandled XHTML feature: "+Integer.toString(child.getNodeType())+descLoc());
child = child.getNextSibling();
}
return res;
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void appendChild(Element e, XhtmlNode node) {
if (node.getNodeType() == NodeType.Comment)
e.appendChild(e.getOwnerDocument().createComment(node.getContent()));
else if (node.getNodeType() == NodeType.DocType)
throw new Error("not done yet");
else if (node.getNodeType() == NodeType.Instruction)
e.appendChild(e.getOwnerDocument().createProcessingInstruction("", node.getContent()));
else if (node.getNodeType() == NodeType.Text)
e.appendChild(e.getOwnerDocument().createTextNode(node.getContent()));
else if (node.getNodeType() == NodeType.Element) {
Element child = e.getOwnerDocument().createElementNS(XHTML_NS, node.getName());
e.appendChild(child);
for (XhtmlNode c : node.getChildNodes()) {
appendChild(child, c);
}
} else
throw new Error("Unknown node type: "+node.getNodeType().toString());
}
代码示例来源:origin: jamesagnew/hapi-fhir
for (XhtmlNode n : x.getChildNodes()) {
lastWS = composePlainText(n, b, lastWS);
代码示例来源:origin: jamesagnew/hapi-fhir
private void writeElement(String indent, XhtmlNode node, boolean noPrettyOverride) throws IOException {
if (!pretty || noPrettyOverride)
indent = "";
// html self closing tags: http://xahlee.info/js/html5_non-closing_tag.html
if (node.getChildNodes().size() == 0 && (xml || Utilities.existsInList(node.getName(), "area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr")))
dst.append(indent + "<" + node.getName() + attributes(node) + "/>" + (pretty && !noPrettyOverride ? "\r\n" : ""));
else {
boolean act = node.allChildrenAreText();
if (act || !pretty || noPrettyOverride)
dst.append(indent + "<" + node.getName() + attributes(node)+">");
else
dst.append(indent + "<" + node.getName() + attributes(node) + ">\r\n");
if (node.getName() == "head" && node.getElement("meta") == null)
dst.append(indent + " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>" + (pretty && !noPrettyOverride ? "\r\n" : ""));
for (XhtmlNode c : node.getChildNodes())
writeNode(indent + " ", c, noPrettyOverride || node.isNoPretty());
if (act)
dst.append("</" + node.getName() + ">" + (pretty && !noPrettyOverride ? "\r\n" : ""));
else if (node.getChildNodes().get(node.getChildNodes().size() - 1).getNodeType() == NodeType.Text)
dst.append((pretty && !noPrettyOverride ? "\r\n"+ indent : "") + "</" + node.getName() + ">" + (pretty && !noPrettyOverride ? "\r\n" : ""));
else
dst.append(indent + "</" + node.getName() + ">" + (pretty && !noPrettyOverride ? "\r\n" : ""));
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void composeElement(IXMLWriter xml, XhtmlNode node, boolean noPrettyOverride) throws IOException {
for (String n : node.getAttributes().keySet()) {
if (n.equals("xmlns"))
xml.setDefaultNamespace(node.getAttributes().get(n));
else if (n.startsWith("xmlns:"))
xml.namespace(n.substring(6), node.getAttributes().get(n));
else
xml.attribute(n, node.getAttributes().get(n));
}
xml.enter(XHTML_NS, node.getName());
for (XhtmlNode n : node.getChildNodes())
compose(xml, n, noPrettyOverride || node.isNoPretty());
xml.exit(XHTML_NS, node.getName());
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void checkInnerNS(List<ValidationMessage> errors, Element e, String path, List<XhtmlNode> list) {
for (XhtmlNode node : list) {
if (node.getNodeType() == NodeType.Element) {
String ns = node.getNsDecl();
rule(errors, IssueType.INVALID, e.line(), e.col(), path, ns == null || FormatUtilities.XHTML_NS.equals(ns), "Wrong namespace on the XHTML ('"+ns+"')");
checkInnerNS(errors, e, path, node.getChildNodes());
}
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void checkInnerNS(List<ValidationMessage> errors, Element e, String path, List<XhtmlNode> list) {
for (XhtmlNode node : list) {
if (node.getNodeType() == NodeType.Element) {
String ns = node.getNsDecl();
rule(errors, IssueType.INVALID, e.line(), e.col(), path, ns == null || FormatUtilities.XHTML_NS.equals(ns), "Wrong namespace on the XHTML ('"+ns+"')");
checkInnerNS(errors, e, path, node.getChildNodes());
}
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
private XhtmlNode parseNode(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
XhtmlNode res = new XhtmlNode(NodeType.Element);
res.setName(xpp.getName());
for (int i = 0; i < xpp.getAttributeCount(); i++) {
if (attributeIsOk(xpp.getName(), xpp.getAttributeName(i), xpp.getAttributeValue(i)))
res.getAttributes().put(xpp.getAttributeName(i), xpp.getAttributeValue(i));
}
int eventType = xpp.next();
while (eventType != XmlPullParser.END_TAG) {
if (eventType == XmlPullParser.TEXT) {
res.addText(xpp.getText());
xpp.next();
} else if (eventType == XmlPullParser.COMMENT) {
res.addComment(xpp.getText());
xpp.next();
} else if (eventType == XmlPullParser.START_TAG) {
if (elementIsOk(xpp.getName()))
res.getChildNodes().add(parseNode(xpp));
} else
throw new FHIRFormatError("Unhandled XHTML feature: "+Integer.toString(eventType)+descLoc());
eventType = xpp.getEventType();
}
xpp.next();
return res;
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void checkInnerNS(List<ValidationMessage> errors, Element e, String path, List<XhtmlNode> list) {
for (XhtmlNode node : list) {
if (node.getNodeType() == NodeType.Element) {
String ns = node.getNsDecl();
rule(errors, IssueType.INVALID, e.line(), e.col(), path, ns == null || FormatUtilities.XHTML_NS.equals(ns), "Wrong namespace on the XHTML ('"+ns+"')");
checkInnerNS(errors, e, path, node.getChildNodes());
}
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
if (i == parents.size())
parents.get(i - 1).getChildNodes().addAll(node.getChildNodes());
node.getChildNodes().clear();
parents.get(i - 1).getChildNodes().addAll(parents.get(i).getChildNodes());
parents.get(i).getChildNodes().clear();
代码示例来源:origin: jamesagnew/hapi-fhir
Piece p = new Piece(c.getName()).setStyle("white-space: pre; font-family: courier");
list.add(p);
p.getChildren().addAll(c.getChildNodes());
} else if (c.getName().equals("ul") || c.getName().equals("ol")) {
Piece p = new Piece(c.getName());
list.add(p);
p.getChildren().addAll(c.getChildNodes());
} else if (c.getName().equals("i")) {
list.add(new Piece(null, c.allText(), null).setStyle("font-style: italic"));
Piece p = new Piece(c.getName());
list.add(p);
p.getChildren().addAll(c.getChildNodes());
} else if (c.getName().equals("br")) {
list.add(new Piece(c.getName()));
代码示例来源:origin: jamesagnew/hapi-fhir
private void checkInnerNames(List<ValidationMessage> errors, Element e, String path, List<XhtmlNode> list) {
for (XhtmlNode node : list) {
if (node.getNodeType() == NodeType.Element) {
rule(errors, IssueType.INVALID, e.line(), e.col(), path, Utilities.existsInList(node.getName(),
"p", "br", "div", "h1", "h2", "h3", "h4", "h5", "h6", "a", "span", "b", "em", "i", "strong",
"small", "big", "tt", "small", "dfn", "q", "var", "abbr", "acronym", "cite", "blockquote", "hr", "address", "bdo", "kbd", "q", "sub", "sup",
"ul", "ol", "li", "dl", "dt", "dd", "pre", "table", "caption", "colgroup", "col", "thead", "tr", "tfoot", "tbody", "th", "td",
"code", "samp", "img", "map", "area"
), "Illegal element name in the XHTML ('"+node.getName()+"')");
for (String an : node.getAttributes().keySet()) {
boolean ok = an.startsWith("xmlns") || Utilities.existsInList(an,
"title", "style", "class", "id", "lang", "xml:lang", "dir", "accesskey", "tabindex",
// tables
"span", "width", "align", "valign", "char", "charoff", "abbr", "axis", "headers", "scope", "rowspan", "colspan") ||
Utilities.existsInList(node.getName()+"."+an, "a.href", "a.name", "img.src", "img.border", "div.xmlns", "blockquote.cite", "q.cite",
"a.charset", "a.type", "a.name", "a.href", "a.hreflang", "a.rel", "a.rev", "a.shape", "a.coords", "img.src",
"img.alt", "img.longdesc", "img.height", "img.width", "img.usemap", "img.ismap", "map.name", "area.shape",
"area.coords", "area.href", "area.nohref", "area.alt", "table.summary", "table.width", "table.border",
"table.frame", "table.rules", "table.cellspacing", "table.cellpadding", "pre.space"
);
if (!ok)
rule(errors, IssueType.INVALID, e.line(), e.col(), path, false, "Illegal attribute name in the XHTML ('"+an+"' on '"+node.getName()+"')");
}
checkInnerNames(errors, e, path, node.getChildNodes());
}
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void checkInnerNames(List<ValidationMessage> errors, Element e, String path, List<XhtmlNode> list) {
for (XhtmlNode node : list) {
if (node.getNodeType() == NodeType.Element) {
rule(errors, IssueType.INVALID, e.line(), e.col(), path, Utilities.existsInList(node.getName(),
"p", "br", "div", "h1", "h2", "h3", "h4", "h5", "h6", "a", "span", "b", "em", "i", "strong",
"small", "big", "tt", "small", "dfn", "q", "var", "abbr", "acronym", "cite", "blockquote", "hr", "address", "bdo", "kbd", "q", "sub", "sup",
"ul", "ol", "li", "dl", "dt", "dd", "pre", "table", "caption", "colgroup", "col", "thead", "tr", "tfoot", "tbody", "th", "td",
"code", "samp", "img", "map", "area"
), "Illegal element name in the XHTML ('"+node.getName()+"')");
for (String an : node.getAttributes().keySet()) {
boolean ok = an.startsWith("xmlns") || Utilities.existsInList(an,
"title", "style", "class", "id", "lang", "xml:lang", "dir", "accesskey", "tabindex",
// tables
"span", "width", "align", "valign", "char", "charoff", "abbr", "axis", "headers", "scope", "rowspan", "colspan") ||
Utilities.existsInList(node.getName()+"."+an, "a.href", "a.name", "img.src", "img.border", "div.xmlns", "blockquote.cite", "q.cite",
"a.charset", "a.type", "a.name", "a.href", "a.hreflang", "a.rel", "a.rev", "a.shape", "a.coords", "img.src",
"img.alt", "img.longdesc", "img.height", "img.width", "img.usemap", "img.ismap", "map.name", "area.shape",
"area.coords", "area.href", "area.nohref", "area.alt", "table.summary", "table.width", "table.border",
"table.frame", "table.rules", "table.cellspacing", "table.cellpadding", "pre.space", "td.nowrap"
);
if (!ok)
rule(errors, IssueType.INVALID, e.line(), e.col(), path, false, "Illegal attribute name in the XHTML ('"+an+"' on '"+node.getName()+"')");
}
checkInnerNames(errors, e, path, node.getChildNodes());
}
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void checkInnerNames(List<ValidationMessage> errors, Element e, String path, List<XhtmlNode> list) {
for (XhtmlNode node : list) {
if (node.getNodeType() == NodeType.Element) {
rule(errors, IssueType.INVALID, e.line(), e.col(), path, Utilities.existsInList(node.getName(),
"p", "br", "div", "h1", "h2", "h3", "h4", "h5", "h6", "a", "span", "b", "em", "i", "strong",
"small", "big", "tt", "small", "dfn", "q", "var", "abbr", "acronym", "cite", "blockquote", "hr", "address", "bdo", "kbd", "q", "sub", "sup",
"ul", "ol", "li", "dl", "dt", "dd", "pre", "table", "caption", "colgroup", "col", "thead", "tr", "tfoot", "tbody", "th", "td",
"code", "samp", "img", "map", "area"
), "Illegal element name in the XHTML ('"+node.getName()+"')");
for (String an : node.getAttributes().keySet()) {
boolean ok = an.startsWith("xmlns") || Utilities.existsInList(an,
"title", "style", "class", "id", "lang", "xml:lang", "dir", "accesskey", "tabindex",
// tables
"span", "width", "align", "valign", "char", "charoff", "abbr", "axis", "headers", "scope", "rowspan", "colspan") ||
Utilities.existsInList(node.getName()+"."+an, "a.href", "a.name", "img.src", "img.border", "div.xmlns", "blockquote.cite", "q.cite",
"a.charset", "a.type", "a.name", "a.href", "a.hreflang", "a.rel", "a.rev", "a.shape", "a.coords", "img.src",
"img.alt", "img.longdesc", "img.height", "img.width", "img.usemap", "img.ismap", "map.name", "area.shape",
"area.coords", "area.href", "area.nohref", "area.alt", "table.summary", "table.width", "table.border",
"table.frame", "table.rules", "table.cellspacing", "table.cellpadding", "pre.space"
);
if (!ok)
rule(errors, IssueType.INVALID, e.line(), e.col(), path, false, "Illegal attribute name in the XHTML ('"+an+"' on '"+node.getName()+"')");
}
checkInnerNames(errors, e, path, node.getChildNodes());
}
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
rule(errors, IssueType.INVALID, e.line(), e.col(), path, FormatUtilities.XHTML_NS.equals(ns), "Wrong namespace on the XHTML ('"+ns+"')");
checkInnerNS(errors, e, path, xhtml.getChildNodes());
rule(errors, IssueType.INVALID, e.line(), e.col(), path, "div".equals(xhtml.getName()), "Wrong name on the XHTML ('"+ns+"') - must start with div");
checkInnerNames(errors, e, path, xhtml.getChildNodes());
代码示例来源:origin: jamesagnew/hapi-fhir
rule(errors, IssueType.INVALID, e.line(), e.col(), path, FormatUtilities.XHTML_NS.equals(ns), "Wrong namespace on the XHTML ('"+ns+"')");
checkInnerNS(errors, e, path, xhtml.getChildNodes());
rule(errors, IssueType.INVALID, e.line(), e.col(), path, "div".equals(xhtml.getName()), "Wrong name on the XHTML ('"+ns+"') - must start with div");
checkInnerNames(errors, e, path, xhtml.getChildNodes());
我认为我正在努力正确定义以下不明确的操作码:LD HL,SP+r8 和 JP (HL) 操作码 (0xE9) > 和 0xF8 分别) 在我的实现中,LD HL,SP+r8 将 HL 设置为 SP+r
我尝试创建一个多线程单例模式类。 标题: class HL{ public: static HL* getInstance(); ......... priva
Windows 7、Emacs 25.1 如果我想改变 hl-line 的背景颜色,我会这样做: (set-face-background 'hl-line "#333333") 好的。但是如何为 h
我使用的是 solr 3.5,并在我的搜索查询中设置了 hl.fragsize = 100 ,但我的片段不完全包含 100 个字符,事实上,平均片段大小是 120。 任何人都可以对这个问题有想法吗?
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
这可以通过以下方式实现: 11 pop hl 10 push hl 在 21 个周期内。我发现的唯一选择是 ex (sp),hl,它需要 19 个周期。缺点是内容必须在我处理完它们后才能恢复到原来的值
我有一个动态文本字段 bar_*在我的索引中,并希望 Solr 返回该字段的突出显示。所以我运行的是: q=gold&hl=true&hl.fl=bar_* 它按预期工作,但以防万一我向 hl.fl
我使用以下代码在全局范围内启用 hl-mode。 (global-hl-line-mode t) 在指定模式下关闭 hl-line 功能。我用下面的代码来做。 (add-hook 'org-mode-
Emacs的hl-line-mode正是我所需要的,但我想更改为可怕的黄色,有人知道我该怎么做吗? 最佳答案 我使用(set-face-background hl-line-face "gray13"
我通过评估突出显示当前行: (hl-line-mode) 也可以全局设置: (global-hl-line-mode nil) 问题是这种方式行突出显示会覆盖highlight-phrase。所以我的
我使用波纹管代码来保护一段 .net 程序。我们选择使用 api 而不是经典的 Envelope 方法,因为我们想要自定义行为而不仅仅是普通窗口“找不到 key ” 我的问题是如何保护供应商代码,因为
我通常让 hl-line 对当前背景采用稍暗的阴影。这在编辑缓冲区时效果很好。但是,在某些缓冲区中,例如 Org 议程和 Gnus 组缓冲区,我想使用更漂亮的颜色(代替光标)。 具体来说,我想更改 g
我使用 Cocoa Emacs 23.1.91,并且我希望始终关闭 hl-line-mode,因为我不喜欢使用它。我可以通过 M-x hl-line-mode 为每个缓冲区关闭它,但这很乏味。任何帮助
我只想知道是否可以制作一个标签或任何其他整数并将其显示到我的游戏 View 中。 var pvElf = SKLabelNode(fontNamed:"Chalkduster") pvElf.text
好的。好吧,我知道这个问题很有可能会在前 10 分钟内结束,但我还是要问这个问题,因为我已经花了将近一天半的时间来寻找解决方案。仍然,我无法弄清楚这一点。尽管有演示,但在 Internet 上甚至在
当我启用 hl-line-mode 时,文件的最后一行只突出显示到它的最后一个字符(如果该行为空,则根本不会突出显示),而不是像其他行一样一直突出显示。一个肮脏的修复是在文件末尾添加一个空行,但我想知
标题基本概括了所有内容。当我:source $MYVIMRC或 :source ~/.vimrc ,重新出现上次搜索。我可以用 :noh 轻松地再次关闭它,但每次我都会重新出现 :source . 这
我们如何配置(或修复?)hl-line,使其背景高亮显示在堆栈中的最后(或第一个?)。 也就是说:如果 hl-line 突出显示某些单词已经具有背景颜色的行,则 hl-line 不应使用自己的背景颜色
使用 solr,我尝试使用 hl.formatter 选项和 hl.simple.pre/post 突出显示一些文本。 我的问题是 hl.simple.pre/post 代码有时没有出现在突出显示的结
我正在尝试为 dired 模式启用 hl-line-mode,但它不起作用。启用 global-hl-mode 有效,但它是每个缓冲区,而不仅仅是我不想要的缓冲区。 (defun hl-mode-fo
我是一名优秀的程序员,十分优秀!