xml-parsing

put xml into Array

那年仲夏 提交于 2019-12-24 17:09:33
问题 I have an xml file, and I need to be able to sort it in either a list or an array The XML: <Restaurant> <name>test</name> <location>test</location> </Restaurant> <Restaurant> <name>test2</name> <location>test2</location> </Restaurant> All the Restaurants will have the same number of fields and the same names for the fields, but the number of <Restaurant></Restaurant> in a given xml file is unknown. In other words, I need an array or list and be able to do this: String name = restaurantArray[0

XPath fails on an XML document in R

这一生的挚爱 提交于 2019-12-24 15:25:23
问题 I'll be glad to find some help with XML manipulation with R. I'm trying to proceed XPath on my XML/TEI file. Here's its structure : <?xml version="1.0" encoding="UTF-8"?> <TEI xmlns="http://www.tei-c.org/ns/1.0"> <text> <body> <div> <p> <seg> <name ref="Actr1235">Jen B.</name>frate M. <name ref="Actr1234">Léard B.</name> rhoncus orci quis luctus ultrices <note place="margin-left">1713 & 1714</note>, a été vehicula cursus nunc, at sagittis lorem aliquet sed <name ref="Actr1236"> Jaes L.</name>

Extracting nested namespace from a xml using lxml

不羁的心 提交于 2019-12-24 15:09:17
问题 I'm new to Python and currently learning to parse XML. All seems to be going well until I hit a wall with nested namespaces. Below is an snippet of my xml ( with a beginning and child element that I'm trying to parse: <?xml version="1.0" encoding="UTF-8"?> -<CompositionPlaylist xmlns="http://www.digicine.com/PROTO-ASDCP-CPL-20040511#"> <!-- Generated by orca_wrapping version 3.8.3-0 --> <Id>urn:uuid:e0e43007-ca9b-4ed8-97b9-3ac9b272be7a</Id> ------------- ------------- ------------- -<cc-cpl

PHP XML - Find out the path to a known value

瘦欲@ 提交于 2019-12-24 14:42:35
问题 Here is an XML bit: [11] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 46e8f57e67db48b29d84dda77cf0ef51 [label] => Publications ) [section] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 9a34d6b273914f18b2273e8de7c48fd6 [label] => Journal Articles [recordId] => 1a5a5710b0e0468e92f9a2ced92906e3 ) I know the value "46e8f57e67db48b29d84dda77cf0ef51" but its location varies across files. Can I use XPath to find the path to this value? If not what

Basic XML parsing issues. Cannot find node names via Java XmlStreamReader method. Any ideas?

自古美人都是妖i 提交于 2019-12-24 13:58:03
问题 Having no luck in parsing some basic XML. I'm doing this in the Apex language, but it's syntactically nearly identical to Java and in this case uses java.xml.stream.XMLStreamReader as its XML parsing engine. The problem is: I'm having no luck getting to any of the actual XML node names. The getLocalName() method within the XmlStreamReader class always returns null for all nodes as I loop through them. code is here Very basic functionality at this point. If you run this, you will see that

XML DOM parsing, getting NULL on every getNodeValue()

∥☆過路亽.° 提交于 2019-12-24 13:49:03
问题 I'm trying to parse an XML file using DOM. But I'm getting NULL values from the nodes, even though, as you can see in the XML file, they all have values... I've been trying for a while but can't find a solution to this issue. I'm quite a newbie to java programming, so it's probably a newbie error, but i'm getting quite frustrated now... This is the XML i'm parsing: <root> <seguro> <seg_tipo>cocacola</seg_tipo> <seg_subtipo>cocacola</seg_subtipo> <seg_title>cocacola</seg_title> <seg_descr

How to get the list of inputs for a particular operation in savon gem

谁说胖子不能爱 提交于 2019-12-24 13:28:38
问题 Is there way to get the list of inputs(arguments) for a particular operation from a wsdl file in savon gem? https://github.com/savonrb/savon 回答1: You can do this with the latest version of Savon (version 3): client = Savon.new('your_wsdl_url') op = client.operation('yourServiceName', 'yourPortName', :yourOperationName) op.example_body See the version 3 documentation for more information: http://savonrb.com/version3.html. This page also provides instructions for installing this version. 来源:

XPath select element based on other elements in node

 ̄綄美尐妖づ 提交于 2019-12-24 13:22:42
问题 My XML doc looks like this: <?xml version="1.0" encoding="ISO-8859-1"?> <XCER xmlns="http://www.x.y.z/base" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.x.y.z/base APSchema.xsd" mp_id="56977" ma_id="398" sub_id="54977"> <final_result OD="DGS=1.7:ADB=2" creator="Px" version="1.1" xsi:type="XCT"> <code>3040280100331</code> <code_cnf>1.0000</code_cnf> <code_attr>seq</code_attr> <status_attr>fdos</status_attr> <text>xxx</text> <standardized_text>xxxx<

Removing Element from XML in C# [duplicate]

你说的曾经没有我的故事 提交于 2019-12-24 13:09:31
问题 This question already has answers here : How to remove an xml element from file? (3 answers) Closed 5 years ago . below is the xml and i need to remove the Element SMS where code equals to "ZOOMLA". i am using C# code as below but it does not work. and gives me "object reference error" XDocument doc = XDocument.Parse (xml); XElement sms = (from xml2 in doc.Descendants ("SMSList").Descendants ("SMS") where xml2.Attribute ("Code").Value == code select xml2).FirstOrDefault (); sms.Remove (); <

Parsing XML file using Java JSTL library; x:out does not display node-specific data

橙三吉。 提交于 2019-12-24 12:09:20
问题 Here is my xml file: <User xmlns="http://schemas.datacontract.org/2004/07/IntranetEFCodeFirst.Objects" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <CostCentre i:nil="true"/> <DeskNo i:nil="true"/> <Domain>MyDomain</Domain> <Email>marco@beirut.co.uk</Email> <Extension>2354</Extension> <FirstName>Marco</FirstName> <KnownAs>Marco l'ancien</KnownAs> </User> If I do this: <c:import url="http://mydomain.co.uk/myFile.xml" var="xmlDoc"/> <x:parse xml="${xmlDoc}" var="output"/> <x:out select=