xml-parsing

how to change /edit node value of xml which have an attribute with key and value pair in android?

喜你入骨 提交于 2019-12-25 01:55:12
问题 how to change /edit node value of xml which have an attribute "add" with key and value pair in android ? Below is my xml , i want to change/edit the value of ipaddress in the xml via android java and save that new file to the text file from which i have read the value of the xml. <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="ip" value="http://192.168.2.56:777/root/Calculator.Add" /> <add key="comport" value="COM9" /> </appSettings> </configuration> to <?xml

Copy XML value using XML twig perl

北城余情 提交于 2019-12-25 01:48:55
问题 I have a nested XML tags and need to have the value of ExternalId in Product XML to a ProductPageURL tag using XML Twig <Products> <Product> <ExternalId>317851</ExternalId> <ProductPageUrl></ProductPageUrl> </Product> <Product> <ExternalId>316232</ExternalId> <ProductPageUrl></ProductPageUrl> </Product> <Product> <ExternalId>13472</ExternalId> <ProductPageUrl></ProductPageUrl> </Product> </Products> Expected result: <Products> <Product> <ExternalId>PF317851</ExternalId> <ProductPageUrl>317851

Import website XML-feed to SQL Server

ⅰ亾dé卋堺 提交于 2019-12-25 01:47:14
问题 Hope you all are doing well. I need to import an XML-feed from a website to my SQL Server database. I don't know much about XML. The feed structure is an bit complex. Here is the sample of that file: <line_feed> <FeedTime>1279519582927</FeedTime> <lastContest>4103839</lastContest> <lastGame>58629754</lastGame> <events> <event> <event_datetimeGMT>2010-07-19 21:30</event_datetimeGMT> <gamenumber>174087393</gamenumber> <sporttype>Tennis</sporttype> <league>abc</league> <participants>

Java XML Parse/Validation Error Handling

拜拜、爱过 提交于 2019-12-25 01:46:43
问题 I'm trying to write something in Java that receives an XML string and validates it against an XSD schema, and does automatic error handling for some simple common errors, and outputs a fixed XML string. I've come across the SAX ErrorHandler interface for the Validator.validate() function, but that seems to be mostly for reporting exceptions and I can't figure out how to modify the XML from it, other than getting the line/column number which would be very tedious to fix problems. I also found

DocumentBuilder.parse() throwing java.net.UnknownHostException after changing a webservice URL from http to https

陌路散爱 提交于 2019-12-25 01:34:05
问题 Previously , we had following code in our application and it used to fetch the required data. We just used to read the required fields by forming a web-service URL by passing username , password and search parameter (DEA number). The same URL (with parameters) could also be hit from browser directly to see the results : { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); System.setProperty("http.proxyHost",

SQL Query XML for Extended Events system table for Session object (not data file) in predicate_XML field

有些话、适合烂在心里 提交于 2019-12-25 01:29:37
问题 I am querying the system tables for Extended Events in SQL to get some data about the extended event itself, and I want to get the database that is set in the Extended Events when its created. if I run this query from system tables here: SELECT SESE.predicate_xml FROM sys.server_event_sessions SEV LEFT OUTER JOIN sys.server_event_session_fields SESF ON SEV.event_session_id = SESF.event_session_id LEFT OUTER JOIN sys.server_event_session_events SESE ON SEV.event_session_id = SESE.event_session

iTextSharp How include GenericTag using XML Parsing

☆樱花仙子☆ 提交于 2019-12-25 01:27:34
问题 I'm using iTextSharp library, specifically to view .xml documents and transform them into .pdf files as follows: var docWriter = PdfWriter.GetInstance(document, new FileStream("DOC.pdf", FileMode.Create)); ITextHandler xmlHandler = new ITextHandler(document); xmlHandler.Parse("MLDOC.xml"); I need to know if there is any way to include any attribute within the tags in my .xml file to indicate that they are GenericTag, or otherwise how I can identify a paragraph which I include a PdfAnnotation

Linq XML descendants being lost on enumeration

六月ゝ 毕业季﹏ 提交于 2019-12-25 00:57:28
问题 I have an XML document like this <root> <item id="1" creator="me"> <childA>1</childA> <childB>2</childB> </item> <item id="2" creator="me"> <childA>1</childA> <childB>3</childB> <childB>4</childB> </item> </root> I'm trying to find duplicate items, then again duplicate child items for the duplicate items with logic like this XDocument XmlRoot //whatever...you get the point // Get item nodes var items = XmlRoot.Descendants("item"); // Find duplicate items keys using creator attribute var

Parsing XML With Single Quotes?

元气小坏坏 提交于 2019-12-25 00:27:49
问题 I am currently running into a problem where an element is coming back from my xml file with a single quote in it. This is causing xml_parse to break it up into multiple chunks, example: Get Wired, You're Hired! Is then enterpreted as 'Get Wired, You' being one object, the single quote being a second, and 're Hired!' as a third. What I want to do is: while($data = fread($fp, 4096)){ if(!xml_parse($xml_parser, htmlentities($data,ENT_QUOTES), feof($fp))) { break; } } But that keeps breaking. I

Reading an XML from a JavaFX application

耗尽温柔 提交于 2019-12-25 00:23:52
问题 I would like to import an XML file via a pop-up window in my JavaFX application. After the importing, I would like to read it. For example I want to store, for every <testbus> the <index> and the <tb_name> in a List or something similar, where the <index> is the index of the List and the <tb_name> is the element of the List . I also would like that for every <testbus> I can access the bitfields and their name. So I was thinking about List of List . I have found a java Library called JAXB that