gpt4 book ai didi

org.hl7.fhir.utilities.xml.XMLUtil类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 08:08:40 27 4
gpt4 key购买 nike

本文整理了Java中org.hl7.fhir.utilities.xml.XMLUtil类的一些代码示例,展示了XMLUtil类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUtil类的具体详情如下:
包路径:org.hl7.fhir.utilities.xml.XMLUtil
类名称:XMLUtil

XMLUtil介绍

暂无

代码示例

代码示例来源:origin: jamesagnew/hapi-fhir

private void loadMessages(Document doc) {
 // TODO Auto-generated method stub
 Element element = XMLUtil.getFirstChild(doc.getDocumentElement());
 while (element != null) {
  messages.put(element.getAttribute("id"), element);
  element = XMLUtil.getNextSibling(element);
 }
}

代码示例来源:origin: jamesagnew/hapi-fhir

private String getRubric(Element cls, String kind) {
 List<Element> rubrics = new ArrayList<Element>(); 
 XMLUtil.getNamedChildren(cls, "Rubric", rubrics);
 for (Element r : rubrics) {
  if (r.getAttribute("kind").equals(kind))
   return XMLUtil.getNamedChild(r,  "Label").getTextContent();
 }
 return null;
}

代码示例来源:origin: jamesagnew/hapi-fhir

private void processOptions(Element wo) {
 XMLUtil.deleteByName(wo, "Unsynced");
 XMLUtil.deleteByName(wo, "Panes");
 for (Element panes : XMLUtil.getNamedChildren(wo, "Panes"))
  processPanes(panes);      
}

代码示例来源:origin: jamesagnew/hapi-fhir

@Override
public WrapperElement getFirstChild() {
 Element res = XMLUtil.getFirstChild(element);
 return res == null ? null : new DOMWrapperElement(res);
}

代码示例来源:origin: jamesagnew/hapi-fhir

private String col(Element row, String name) {
  Element e = XMLUtil.getNamedChild(row, name);
  if (e == null)
    return null;
  String text = e.getTextContent();
  return text;
}

代码示例来源:origin: jamesagnew/hapi-fhir

private void parseChildren(String path, org.w3c.dom.Element node, Element context) throws FHIRFormatError, FHIRException, IOException, DefinitionException {
 List<Property> properties = context.getProperty().getChildProperties(context.getName(), XMLUtil.getXsiType(node));
  String text = XMLUtil.getDirectText(node).trim();
 if (!Utilities.noString(text)) {
   Property property = getTextProp(properties);

代码示例来源:origin: jamesagnew/hapi-fhir

XMLUtil.deleteByName(root, "ActiveSheet");
Element xw = XMLUtil.getNamedChild(root, "ExcelWorkbook");
XMLUtil.deleteByName(xw, "WindowHeight");
XMLUtil.deleteByName(xw, "WindowWidth");
XMLUtil.deleteByName(xw, "WindowTopX");
XMLUtil.deleteByName(xw, "WindowTopY");
for (Element wk : XMLUtil.getNamedChildren(root, "Worksheet"))
 processWorksheet(wk);

代码示例来源:origin: jamesagnew/hapi-fhir

public static void deleteByName(Element e, String name) {
 List<Element> matches = getNamedChildren(e, name);
 for (Element m : matches)
  e.removeChild(m);    
}

代码示例来源:origin: jamesagnew/hapi-fhir

@Override
public WrapperElement getNextSibling() {
 Element res = XMLUtil.getNextSibling(element);
 return res == null ? null : new DOMWrapperElement(res);
}

代码示例来源:origin: jamesagnew/hapi-fhir

private void parseResource(String string, org.w3c.dom.Element container, Element parent) throws Exception {
  org.w3c.dom.Element res = XMLUtil.getFirstChild(container);
  String name = res.getLocalName();
  StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+name);
  if (sd == null)
    throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+res.getLocalName()+"')");
  parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), parent.getProperty().getName().equals("contained") ? SpecialElement.CONTAINED : SpecialElement.BUNDLE_ENTRY);
  parent.setType(name);
  parseChildren(res.getLocalName(), res, parent);
}

代码示例来源:origin: jamesagnew/hapi-fhir

public static String getNamedChildAttribute(Element element, String name, String aname) {
 Element e = getNamedChild(element, name);
 return e == null ? null : e.getAttribute(aname);
}

代码示例来源:origin: jamesagnew/hapi-fhir

private void parseChildren(String path, org.w3c.dom.Element node, Element context) throws Exception {
  List<Property> properties = getChildProperties(context.getProperty(), context.getName(), XMLUtil.getXsiType(node));
  String text = XMLUtil.getDirectText(node).trim();
  if (!Utilities.noString(text)) {
    Property property = getTextProp(properties);

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-utilities

XMLUtil.deleteByName(root, "ActiveSheet");
Element xw = XMLUtil.getNamedChild(root, "ExcelWorkbook");
XMLUtil.deleteByName(xw, "WindowHeight");
XMLUtil.deleteByName(xw, "WindowWidth");
XMLUtil.deleteByName(xw, "WindowTopX");
XMLUtil.deleteByName(xw, "WindowTopY");
for (Element wk : XMLUtil.getNamedChildren(root, "Worksheet"))
 processWorksheet(wk);

代码示例来源:origin: jamesagnew/hapi-fhir

@Override
public void getNamedChildren(String name, List<WrapperElement> list) {
 List<Element> el = new ArrayList<Element>();
 XMLUtil.getNamedChildren(element, name, el);
 for (Element e : el)
  list.add(new DOMWrapperElement(e));
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-validation

@Override
public WrapperElement getNextSibling() {
 Element res = XMLUtil.getNextSibling(element);
 return res == null ? null : new DOMWrapperElement(res);
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-utilities

private void processOptions(Element wo) {
 XMLUtil.deleteByName(wo, "Unsynced");
 XMLUtil.deleteByName(wo, "Panes");
 for (Element panes : XMLUtil.getNamedChildren(wo, "Panes"))
  processPanes(panes);      
}

代码示例来源:origin: jamesagnew/hapi-fhir

private String getByLang(Element msg, String lang) {
 Element c = XMLUtil.getFirstChild(msg);
 while (c != null) {
  if (c.getAttribute("lang").equals(lang))
   return c.getTextContent();
  c = XMLUtil.getNextSibling(c);
 }
 return null;
}

代码示例来源:origin: jamesagnew/hapi-fhir

private void processWorksheet(Element wk) throws FHIRException  {
 Element tbl = XMLUtil.getNamedChild(wk, "Table");
 processTable(tbl);
 for (Element row : XMLUtil.getNamedChildren(tbl, "Row"))
  processRow(row);      
 for (Element col : XMLUtil.getNamedChildren(tbl, "Column"))
  processCol(col);      
 for (Element wo : XMLUtil.getNamedChildren(wk, "WorksheetOptions"))
  processOptions(wo);      
}

代码示例来源:origin: jamesagnew/hapi-fhir

private void parseResource(String string, org.w3c.dom.Element container, Element parent, Property elementProperty) throws FHIRFormatError, DefinitionException, FHIRException, IOException {
  org.w3c.dom.Element res = XMLUtil.getFirstChild(container);
 String name = res.getLocalName();
 StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, context.getOverrideVersionNs()));
 if (sd == null)
  throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+res.getLocalName()+"')");
 parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty);
 parent.setType(name);
 parseChildren(res.getLocalName(), res, parent);
 }

代码示例来源:origin: jamesagnew/hapi-fhir

public static String getNamedChildValue(Element element, String name) {
 Element e = getNamedChild(element, name);
 return e == null ? null : e.getAttribute("value");
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com