xml-parsing

Windows & Mac XML library for delphi XE2

独自空忆成欢 提交于 2020-01-25 06:12:11
问题 What is the best (easy to use, performances) library to manage XML on Delphi XE2. Windows and Mac targets in mind. 回答1: You can use OmniXML, it is: 100% written in delphi Has no outer dependencies Works on XE2, did not test it on OSX On top of OmniXML you can use SimpleStorage to give you more power and simplicity managing the XML. 回答2: I usually go for the NativeXML library, it's an XML library completely written in Delphi code and it's free. I'm not sure if the latest version offers

adding namespace and namespace prefix using dom4j

杀马特。学长 韩版系。学妹 提交于 2020-01-25 03:18:05
问题 i am updating one xml using dom4j as below. SAXReader reader = new SAXReader(); document = reader.read( xmlFileName ); but it removes all namespaces from the elements so wanna add manually but it does not work when i tried the following code. Element e1 = root.addElement("jmsProducer"); e1.addNamespace("AEService", "http://www.tibco.com/xmlns/aemeta/services/2002"); my xml looks like <AEService:jmsProducer objectType="endpoint.JMSPublisher" name="Pub1EndPoint"> <AEService:wireFormat>aeXml<

XPATH: how get .length of 1st element group and .length of 2nd element group inside 1st group?

时间秒杀一切 提交于 2020-01-25 01:25:09
问题 I'm working with xml files having the structure set out below. <GroupType1> and <GroupType2> need to be processed separately. In either case, I want to loop through the <OperationEvent> elements in each <OperationStage> using XPATH. So, for each <GroupType1> , I need to get the number of <OperationStage> in <OperationStageCollection> , then get the number of <OperationEvent> in the <OperationEventCollection> of the current <OperationStage> . In pseudocode, the processing would be: For i = 1

Java jdom xml parsing

空扰寡人 提交于 2020-01-25 00:33:05
问题 it's my first day with java and I try to build a little xml parser for my websites, so I can have a clean look on my sitemaps.xml . The code I use is like that import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.net.URL; import java.util.List; import org.jdom2.Element; import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; class downloadxml { public static void main(String[] args) throws IOException { String str = "http://www.someurl

Extract value from xml in shell

人走茶凉 提交于 2020-01-24 21:55:26
问题 I have to following xml structure: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE DOC SYSTEM "ts.dtd"> <?xml-stylesheet type="text/css" href="ts.css"?> <DOC LOCALE="en-US"> <PTXT ID="some.first.id" CONTEXT="">Some text 1</PTXT> <PTXT ID="some.second.id" CONTEXT="">Some text 2</PTXT> </DOC> Now my challenge is to loop on every PTXT tag and do something with the ID and the inner text. For example purposes, let's just say that I need to echo something like some.first.id Some text 1 some.second

Java Document builder returning null Document for Xml String

℡╲_俬逩灬. 提交于 2020-01-24 21:18:52
问题 I have tried all possible answers on Stackoverflow but I can't get this resolved. I have the following xml as a String: private static final String xmlStr = "<parameters>\n" + " <parameter>\n" + " <name>emp</name>\n" + " <keyvalue>John Smith</keyvalue>\n" + " </parameter>\n" + " <parameter>\n" + " <name>age</name>\n" + " <keyvalue>22</keyvalue>\n" + " </parameter>\n" + " <parameter>\n" + " <name>Birth Date</name>\n" + " <keyvalue>02/05/1978</keyvalue>\n" + " </parameter>\n" + " <parameter>\n"

Java Document builder returning null Document for Xml String

血红的双手。 提交于 2020-01-24 21:18:06
问题 I have tried all possible answers on Stackoverflow but I can't get this resolved. I have the following xml as a String: private static final String xmlStr = "<parameters>\n" + " <parameter>\n" + " <name>emp</name>\n" + " <keyvalue>John Smith</keyvalue>\n" + " </parameter>\n" + " <parameter>\n" + " <name>age</name>\n" + " <keyvalue>22</keyvalue>\n" + " </parameter>\n" + " <parameter>\n" + " <name>Birth Date</name>\n" + " <keyvalue>02/05/1978</keyvalue>\n" + " </parameter>\n" + " <parameter>\n"

How to get element data from Soap Web Response? VB.NET

泄露秘密 提交于 2020-01-23 21:36:46
问题 I'm trying to get data from a webservice, returning just one result, the number of a given item in stock. I'm successfully getting a result, but need to strip all the XML code from it to simple return the number, the XML being returned looks like: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <stockenquiryResponse xmlns=

How to get element data from Soap Web Response? VB.NET

不打扰是莪最后的温柔 提交于 2020-01-23 21:36:28
问题 I'm trying to get data from a webservice, returning just one result, the number of a given item in stock. I'm successfully getting a result, but need to strip all the XML code from it to simple return the number, the XML being returned looks like: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <stockenquiryResponse xmlns=

How would I create a callback around an XML request?

冷暖自知 提交于 2020-01-23 17:09:10
问题 I've been trying to understand how callbacks work in Swift. I've gone over quite a few examples (like this one) that have helped me to better understand callbacks, but I haven't had any luck in properly implementing one. I have a function that accepts a URL, downloads some XML data from a web api and then parses it into objects. At the same time I have a UILabel that is waiting for some data from the XML request. Below is a partial example of my function that I'd like to set up with a