xml-parsing

android.view.WindowLeaked exception

。_饼干妹妹 提交于 2019-12-04 04:08:27
I'm reading xml data from a url. It worked well when it was it portrait mode. But I wanted to change it to landscape mode. But it gets android.view.WindowLeaked exception. Please help me with this. Thanks in advance. This is my code. package com.eisuru.abc; import android.os.AsyncTask; import android.os.Bundle; import android.app.Activity; import android.app.ProgressDialog; import android.content.pm.ActivityInfo; import android.view.Menu; import android.widget.TextView; public class MainActivity extends Activity { TextView tvResponse; @Override protected void onCreate(Bundle savedInstanceState

XPath to get all text in element as one value, removing line breaks

情到浓时终转凉″ 提交于 2019-12-04 03:24:33
I am trying to get all the text in a node for a following set and returning as one value (not multiple nodes). <p> "I love eating out." <br> <br> "This is my favorite restaurant." <br> "I will definitely be back" </p> I am using '/p' and get all the results but it returns with line breaks. Also trying '/p/text()' results in getting each text between each tag as a separate returned value. The ideal return would be -- "I love eating out. This is my favorite restaurant. I will definitely be back" I've tried searching other questions but couldn't find something as close. Please not that in the

XML Parsing error: no element found. How to resolve it?

霸气de小男生 提交于 2019-12-04 02:50:32
问题 I am beginner on Android Studio and I found an error during Android app development that the Android Studio shows: XML Parsing error: no element found How do I resolve it? Error is still maintained after adding some suggestions. please review it. Now it Shows : Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] Configuration on demand is an incubating feature. NDK is missing a "platforms" directory

Parse a list of XML fragments with no root element from a stream input

倖福魔咒の 提交于 2019-12-04 02:48:56
Is it feasible in Java using the SAX api to parse a list of XML fragments with no root element from a stream input? I tried parsing such an XML but got a org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. before even the endDocument event was fired. I would like not to settle with obvious but clumsy solutions as "Pre-append a custom root element or Use buffered fragment parsing". I am using the standard SAX API of Java 1.6. The SAX factory had setValidating(false) in case anyone wondered. npe First, and most important of all, the content

extract text from xml documents in python

此生再无相见时 提交于 2019-12-04 02:35:53
问题 This is the sample xml document : <bookstore> <book category="COOKING"> <title lang="english">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>300.00</price> </book> <book category="CHILDREN"> <title lang="english">Harry Potter</title> <author>J K. Rowling </author> <year>2005</year> <price>625.00</price> </book> </bookstore> I want to extract the text without specifying the elements how can i do this , because i have 10 such documents. I want so because

How to read XML file using XmlSerializer C# [duplicate]

安稳与你 提交于 2019-12-04 02:35:19
问题 This question already has an answer here : Deserialization of xml file by using XmlArray? (1 answer) Closed 3 years ago . I have a problem when I want to read XML file by using XmlSerializer. My xml file like follow : <?xml version="1.0" encoding="utf-8"?> <contents> <section id="1"> <element1>2</element1> <element2>1</element2> <idx>1</idx> <idx>2</idx> <idx>3</idx> </section> <section id="2"> <element1>2</element1> <element2>1</element2> </section> <section id="3"/> </contents> Here are the

Why can't I parse a XML file using QXmlStreamReader from Qt?

怎甘沉沦 提交于 2019-12-04 02:24:37
I'm trying to figure out how QXmlStreamReader works for a C++ application I'm writing. The XML file I want to parse is a large dictionary with a convoluted structure and plenty of Unicode characters so I decided to try a small test case with a simpler document. Unfortunately, I hit a wall. Here's the example xml file: <?xml version="1.0" encoding="UTF-8" ?> <persons> <person> <firstname>John</firstname> <surname>Doe</surname> <email>john.doe@example.com</email> <website>http://en.wikipedia.org/wiki/John_Doe</website> </person> <person> <firstname>Jane</firstname> <surname>Doe</surname> <email

Converting input XML using XSLT to other XML

人走茶凉 提交于 2019-12-04 02:19:58
问题 I am a beginner and want to learn XSLT. I came upon an issue converting an input XML file to another XML file using XSLT. My input XML file: <album> <album_num>hi.hello</album_num> <album_name>Cocktail</album_name> </album> <album> <album_num>hey.hello</album_num> <album_name>Mocktail</album_name> </album> <album> <album_num>hey.mello</album_num> <album_name>Monkeytail</album_name> </album> <album> <album_num>hey.yellow</album_num> <album_name>Donkeytail</album_name> </album> <album> <album

java xml cast Node to Element

两盒软妹~` 提交于 2019-12-04 02:09:15
I know this was asked many times but I still cannot get it to work. I convert xml string to Document object and then parse it. Here is the code: import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.*; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); Document document = builder.parse( new InputSource( new StringReader( result ) ) ); Node head = document.getFirstChild(); if(head != null) { NodeList airportList = head.getChildNodes(); for(int i=0; i

Flex TextArea - copy/paste from Word - Invalid unicode characters on xml parsing

六眼飞鱼酱① 提交于 2019-12-04 02:06:05
问题 EDIT: Please visit here: Flex textArea remove/replace invalid little squares Seems to be the issue & need to find a solution for this. ORIGINAL: We have an application where users can create an email message & send it to different users. We create the email message as an XML message (sender, destination, subject, body, etc.) & put it on the queue. Another application picks up the message, parses it & sends out the emails. We have no control over it. Now the problem is during testing, our