org.openmobster.core.common.XMLUtilities.parse()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(121)

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

XMLUtilities.parse介绍

[英]Parses an input stream of xml data into a DOM tree
[中]将xml数据的输入流解析为DOM树

代码示例

代码示例来源:origin: org.openmobster.core/synchronizer

public String parseId(String xml) throws SyncException
{
  String recordId = null;
  Document document = XMLUtilities.parse(xml);
  Element id = (Element) document.getElementsByTagName("recordId").item(0);
  recordId = XMLUtilities.restoreXML(id.getTextContent());
  
  //Perform any local id to server side id mappings if applies
  recordId = mapEngine.mapFromLocalToServer(recordId);
  
  return recordId;
}

代码示例来源:origin: org.openmobster.core/moblet-management

private List<MobletApp> parseMobletApps(String deploymentUrl,InputStream is) throws Exception
{
  List<MobletApp> apps = new ArrayList<MobletApp>();
  
  Document root = XMLUtilities.parse(is);
  
  NodeList mobletAppNodes = root.getElementsByTagName("moblet-app");
  if(mobletAppNodes != null && mobletAppNodes.getLength()>0)
  {
    int size = mobletAppNodes.getLength();
    for(int i=0; i<size; i++)
    {
      Element mobletAppElem = (Element)mobletAppNodes.item(i);
      MobletApp app = this.parseMobletApp(mobletAppElem);
      app.setDeploymentUrl(deploymentUrl);
      apps.add(app);
    }
  }
  
  return apps;
}

代码示例来源:origin: org.openmobster.core/synchronizer

/**
 * 
 * @param xml
 * @return
 */
public Anchor parseAnchor(String xml)
{
  Anchor anchor = new Anchor();
  
  Document document = XMLUtilities.parse(xml);
  
  Element lastSync = (Element)document.getElementsByTagName(SyncXMLTags.Last).item(0);
  Element nextSync = (Element)document.getElementsByTagName(SyncXMLTags.Next).item(0);
  
  anchor.setLastSync(lastSync.getFirstChild().getNodeValue());
  anchor.setNextSync(nextSync.getFirstChild().getNodeValue());
  
  return anchor;
}
//-------------------------------------------------------------------------------------------------

代码示例来源:origin: org.openmobster.core/dataService

Document document = XMLUtilities.parse(payload);

代码示例来源:origin: org.openmobster.core/mobileObject

Document root = XMLUtilities.parse(deviceXml);

代码示例来源:origin: org.openmobster.core/synchronizer

Document document = XMLUtilities.parse(xml);
Element syncHeader = (Element)document.getElementsByTagName(SyncXMLTags.SyncHdr).item(0);
Element syncBody = (Element)document.getElementsByTagName(SyncXMLTags.SyncBody).item(0);

代码示例来源:origin: org.openmobster.core/synchronizer

Document document = XMLUtilities.parse(xml);
Element syncHeader = (Element)document.getElementsByTagName(SyncXMLTags.SyncHdr).item(0);
Element syncBody = (Element)document.getElementsByTagName(SyncXMLTags.SyncBody).item(0);

代码示例来源:origin: org.openmobster.core/synchronizer

Document document = XMLUtilities.parse(xml);
Element syncHeader = (Element)document.getElementsByTagName(SyncXMLTags.SyncHdr).item(0);
Element syncBody = (Element)document.getElementsByTagName(SyncXMLTags.SyncBody).item(0);

代码示例来源:origin: org.openmobster.core/synchronizer

Document document = XMLUtilities.parse(xml);
Element syncHeader = (Element)document.getElementsByTagName(SyncXMLTags.SyncHdr).item(0);
Element syncBody = (Element)document.getElementsByTagName(SyncXMLTags.SyncBody).item(0);

代码示例来源:origin: org.openmobster.core/synchronizer

Document document = XMLUtilities.parse(xml);
Element syncHeader = (Element)document.getElementsByTagName(SyncXMLTags.SyncHdr).item(0);
Element syncBody = (Element)document.getElementsByTagName(SyncXMLTags.SyncBody).item(0);

代码示例来源:origin: org.openmobster.core/location

Document root = XMLUtilities.parse(xml);

代码示例来源:origin: org.openmobster.core/location

Document document = XMLUtilities.parse(payload);

代码示例来源:origin: org.openmobster.core/mobileContainer

Document root = XMLUtilities.parse(deviceXml);

代码示例来源:origin: org.openmobster.core/location

Document root = XMLUtilities.parse(xml);

代码示例来源:origin: org.openmobster.core/location

Document root = XMLUtilities.parse(xml);

相关文章