- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.hl7.fhir.utilities.xhtml.XhtmlNode.getName()
方法的一些代码示例,展示了XhtmlNode.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XhtmlNode.getName()
方法的具体详情如下:
包路径:org.hl7.fhir.utilities.xhtml.XhtmlNode
类名称:XhtmlNode
方法名:getName
暂无
代码示例来源:origin: jamesagnew/hapi-fhir
private void processFootNodeRef(IXMLWriter xml, XhtmlNode n) {
throw new Error("element "+n.getName()+" not handled yet");
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void processTFoot(IXMLWriter xml, XhtmlNode n) {
throw new Error("element "+n.getName()+" not handled yet");
}
代码示例来源:origin: jamesagnew/hapi-fhir
private void processFootNote(IXMLWriter xml, XhtmlNode n) {
throw new Error("element "+n.getName()+" not handled yet");
}
代码示例来源:origin: jamesagnew/hapi-fhir
public XhtmlNode getElement(String name) {
for (XhtmlNode n : childNodes)
if (n.getNodeType() == NodeType.Element && name.equals(n.getName()))
return n;
return null;
}
代码示例来源: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
if (x.getName().equals("li")) {
b.append("* ");
lastWS = true;
lastWS = composePlainText(n, b, lastWS);
if (x.getName().equals("p")) {
b.append("\r\n\r\n");
lastWS = true;
if (x.getName().equals("br") || x.getName().equals("li")) {
b.append("\r\n");
lastWS = true;
代码示例来源:origin: jamesagnew/hapi-fhir
list.add(new Piece(null, c.getContent(), null));
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"));
} else if (c.getName().equals("code")) {
list.add(new Piece(null, c.allText(), null).setStyle("padding: 2px 4px; color: #005c00; background-color: #f9f2f4; white-space: nowrap; border-radius: 4px"));
} else if (c.getName().equals("i")) {
list.add(new Piece(null, c.allText(), null).setStyle("font-style: italic"));
} else if (c.getName().equals("pre")) {
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"));
} else if (c.getName().equals("h1")||c.getName().equals("h2")||c.getName().equals("h3")||c.getName().equals("h4")) {
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()));
} else {
throw new Error("Not handled yet: "+c.getName());
代码示例来源:origin: jamesagnew/hapi-fhir
return;
case Element:
if (n.getName().equals("br"))
processBreak(xml, n);
else if (n.getName().equals("h2"))
processCaption(xml, n);
else if (n.getName().equals("col"))
processCol(xml, n);
else if (n.getName().equals("colgroup"))
processColGroup(xml, n);
else if (n.getName().equals("span"))
processContent(xml, n);
else if (n.getName().equals("footnote"))
processFootNote(xml, n);
else if (n.getName().equals("footnoteRef"))
processFootNodeRef(xml, n);
else if (n.getName().equals("li"))
processItem(xml, n);
else if (n.getName().equals("linkHtml"))
processlinkHtml(xml, n);
else if (n.getName().equals("ul") || n.getName().equals("ol"))
processList(xml, n);
else if (n.getName().equals("p"))
processParagraph(xml, n);
else if (n.getName().equals("img"))
processRenderMultiMedia(xml, n);
else if (n.getName().equals("sub"))
processSub(xml, n);
else if (n.getName().equals("sup"))
代码示例来源: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
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 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"
);
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 processList(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException {
if (n.getName().equals("ol"))
xml.attribute("listType", "ordered");
else
xml.attribute("listType", "unordered");
processAttributes(n, xml, "id", "language", "styleCode");
xml.enter("list");
processChildren(xml, n);
xml.exit("list");
}
代码示例来源:origin: jamesagnew/hapi-fhir
readChar();
QName n = new QName(readToTagEnd());
if (node.getName().equals(n.getName()))
return;
else
throw new FHIRFormatError("Malformed XHTML: Found \"</"+n.getName()+">\" expecting \"</"+node.getName()+">\""+descLoc());
for (int i = parents.size() - 1; i >= 0; i--)
if (parents.get(i).getName().equals(n))
unwindPoint = parents.get(i);
throw new FHIRFormatError("Unable to Parse HTML - node '" + node.getName() + "' has unexpected content '"+peekChar()+"' (last text = '"+lastText+"'"+descLoc());
代码示例来源:origin: jamesagnew/hapi-fhir
if (name.length() == 0)
throw new FHIRFormatError("Unable to read attribute on <"+node.getName()+">"+descLoc());
else if (peekChar() != '=')
throw new FHIRFormatError("Unable to read attribute '"+name+"' value on <"+node.getName()+">"+descLoc());
代码示例来源:origin: jamesagnew/hapi-fhir
rule(errors, IssueType.INVALID, e.line(), e.col(), path, "div".equals(xhtml.getName()), "Wrong name on the XHTML ('"+ns+"') - must start with div");
代码示例来源:origin: jamesagnew/hapi-fhir
rule(errors, IssueType.INVALID, e.line(), e.col(), path, "div".equals(xhtml.getName()), "Wrong name on the XHTML ('"+ns+"') - must start with div");
代码示例来源:origin: jamesagnew/hapi-fhir
rule(errors, IssueType.INVALID, e.line(), e.col(), path, "div".equals(xhtml.getName()), "Wrong name on the XHTML ('"+ns+"') - must start with div");
我想了解 Ruby 方法 methods() 是如何工作的。 我尝试使用“ruby 方法”在 Google 上搜索,但这不是我需要的。 我也看过 ruby-doc.org,但我没有找到这种方法。
Test 方法 对指定的字符串执行一个正则表达式搜索,并返回一个 Boolean 值指示是否找到匹配的模式。 object.Test(string) 参数 object 必选项。总是一个
Replace 方法 替换在正则表达式查找中找到的文本。 object.Replace(string1, string2) 参数 object 必选项。总是一个 RegExp 对象的名称。
Raise 方法 生成运行时错误 object.Raise(number, source, description, helpfile, helpcontext) 参数 object 应为
Execute 方法 对指定的字符串执行正则表达式搜索。 object.Execute(string) 参数 object 必选项。总是一个 RegExp 对象的名称。 string
Clear 方法 清除 Err 对象的所有属性设置。 object.Clear object 应为 Err 对象的名称。 说明 在错误处理后,使用 Clear 显式地清除 Err 对象。此
CopyFile 方法 将一个或多个文件从某位置复制到另一位置。 object.CopyFile source, destination[, overwrite] 参数 object 必选
Copy 方法 将指定的文件或文件夹从某位置复制到另一位置。 object.Copy destination[, overwrite] 参数 object 必选项。应为 File 或 F
Close 方法 关闭打开的 TextStream 文件。 object.Close object 应为 TextStream 对象的名称。 说明 下面例子举例说明如何使用 Close 方
BuildPath 方法 向现有路径后添加名称。 object.BuildPath(path, name) 参数 object 必选项。应为 FileSystemObject 对象的名称
GetFolder 方法 返回与指定的路径中某文件夹相应的 Folder 对象。 object.GetFolder(folderspec) 参数 object 必选项。应为 FileSy
GetFileName 方法 返回指定路径(不是指定驱动器路径部分)的最后一个文件或文件夹。 object.GetFileName(pathspec) 参数 object 必选项。应为
GetFile 方法 返回与指定路径中某文件相应的 File 对象。 object.GetFile(filespec) 参数 object 必选项。应为 FileSystemObject
GetExtensionName 方法 返回字符串,该字符串包含路径最后一个组成部分的扩展名。 object.GetExtensionName(path) 参数 object 必选项。应
GetDriveName 方法 返回包含指定路径中驱动器名的字符串。 object.GetDriveName(path) 参数 object 必选项。应为 FileSystemObjec
GetDrive 方法 返回与指定的路径中驱动器相对应的 Drive 对象。 object.GetDrive drivespec 参数 object 必选项。应为 FileSystemO
GetBaseName 方法 返回字符串,其中包含文件的基本名 (不带扩展名), 或者提供的路径说明中的文件夹。 object.GetBaseName(path) 参数 object 必
GetAbsolutePathName 方法 从提供的指定路径中返回完整且含义明确的路径。 object.GetAbsolutePathName(pathspec) 参数 object
FolderExists 方法 如果指定的文件夹存在,则返回 True;否则返回 False。 object.FolderExists(folderspec) 参数 object 必选项
FileExists 方法 如果指定的文件存在返回 True;否则返回 False。 object.FileExists(filespec) 参数 object 必选项。应为 FileS
我是一名优秀的程序员,十分优秀!