Search Results

Search found 1820 results on 73 pages for 'parser combinators'.

Page 13/73 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • JDOM Parser and Namespace how to get clean Content

    - by senzacionale
    MY xml: <?xml version="1.0"?> <company xmlns="http://www.xx.com/xx"> <staff> <firstname>yong</firstname> <lastname>mook kim</lastname> <nickname>mkyong</nickname> <salary>100000</salary> </staff> <staff> <firstname>low</firstname> <lastname>yin fong</lastname> <nickname>fong fong</nickname> <salary>200000</salary> </staff> </company> Reader in = new StringReader(message); Document document = (Document)saxBuilder.build(in); Element rootNode = document.getRootElement(); List<?> list = rootNode.getChildren("staff", Namespace.getNamespace("xmlns="http://www.infonova.com/MediationFeed"")); XMLOutputter outp = new XMLOutputter(); outp.setFormat(Format.getCompactFormat()); for (int ii = 0; ii < list.size(); ii++) { Element node = (Element)list.get(ii); StringWriter sw = new StringWriter(); outp.output(node.getContent(), sw); StringBuffer sb = sw.getBuffer(); String xml = sb.toString(); } but my xml object looks like this <firstname xmlns="http://www.xx.com/xx">yong</firstname> <lastname xmlns="http://www.xx.com/xx">mook kim</lastname> <nickname xmlns="http://www.xx.com/xx">mkyong</nickname> <salary xmlns="http://www.xx.com/xx">100000</salary> every elemnt has namespace. why this? i don't want namespace... I want the same output as is in xml example like <firstname>yong</firstname> <lastname>mook kim</lastname> <nickname>mkyong</nickname> <salary>100000</salary>

    Read the article

  • Use a non-coalescing parser in Axis2

    - by Nathan
    Does anyone know how I can get Axis2 to use a non-coalescing XMLStreamReader when it parses a SOAP message? I am writing code that reads a large base64 binary text element. Coalescing is the default behaviour, and this causes the default XMLStreamReader to load the entire text into memory rather than returning multiple CHARACTERS events. The upshot of this is that I run out of heap space when running the following code: reader = element.getTextAsStream( true ); The OutOfMemory error occurs in com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next: java.lang.OutOfMemoryError: Java heap space at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(XMLStringBuffer.java:208) at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(XMLStringBuffer.java:226) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanContent(XMLDocumentFragmentScannerImpl.java:1552) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2864) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:558) at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225) at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34) at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225) at org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSXPStreamReaderWrapper.java:138) at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:668) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214) at org.apache.axiom.om.impl.llom.SwitchingWrapper.updateNextNode(SwitchingWrapper.java:1098) at org.apache.axiom.om.impl.llom.SwitchingWrapper.<init>(SwitchingWrapper.java:198) at org.apache.axiom.om.impl.llom.OMStAXWrapper.<init>(OMStAXWrapper.java:73) at org.apache.axiom.om.impl.llom.OMContainerHelper.getXMLStreamReader(OMContainerHelper.java:67) at org.apache.axiom.om.impl.llom.OMContainerHelper.getXMLStreamReader(OMContainerHelper.java:40) at org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader(OMElementImpl.java:790) at org.apache.axiom.om.impl.llom.OMElementImplUtil.getTextAsStream(OMElementImplUtil.java:114) at org.apache.axiom.om.impl.llom.OMElementImpl.getTextAsStream(OMElementImpl.java:826) at org.example.UploadFileParser.invokeBusinessLogic(UploadFileParser.java:160)

    Read the article

  • SAX Parser Exceprtion

    - by sairam333
    When I run my application the following error willl be occured some times only,Can u explain why it is occured some times only and what i sthe solution for this and the error message is 03-13 14:38:18.055: WARN/System.err(1866): org.xml.sax.SAXParseException: expected: '' actual: '?' (position:END_TAG @137:35 in java.io.StringReader@438e0ef0) 03-13 14:38:18.064: WARN/System.err(1866): at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:151) 03-13 14:38:18.074: WARN/System.err(1866): at com.fitzengineering.teslaworldnet.interfacelayer.ParseXMLString.convertPeoples(ParseXMLString.java:484) 03-13 14:38:18.074: WARN/System.err(1866): at com.fitzengineering.teslaworldnet.presentationlayer.People.onCreate(People.java:91) 03-13 14:38:18.074: WARN/System.err(1866): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 03-13 14:38:18.084: WARN/System.err(1866): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) 03-13 14:38:18.095: WARN/System.err(1866): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) 03-13 14:38:18.104: WARN/System.err(1866): at android.app.ActivityThread.access$1800(ActivityThread.java:112)03-13 14:38:18.104: WARN/System.err(1866): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 03-13 14:38:18.114: WARN/System.err(1866): at android.os.Handler.dispatchMessage(Handler.java:99) 03-13 14:38:18.124: WARN/System.err(1866): at android.os.Looper.loop(Looper.java:123) 03-13 14:38:18.134: WARN/System.err(1866): at android.app.ActivityThread.main(ActivityThread.java:3948) 03-13 14:38:18.134: WARN/System.err(1866): at java.lang.reflect.Method.invokeNative(Native Method) 03-13 14:38:18.144: WARN/System.err(1866): at java.lang.reflect.Method.invoke(Method.java:521) 03-13 14:38:18.144: WARN/System.err(1866): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 03-13 14:38:18.154: WARN/System.err(1866): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 03-13 14:38:18.154: WARN/System.err(1866): Thanks in advance

    Read the article

  • SVG Parser in Javascript

    - by jsight
    I believe that at one point, I saw a TinySVG implementation that worked in the browser, using the canvas element as the backend. I found a few sites that appeared to indicate it was at http://fuchsia-design.com/CanvaSVG/, however, that site appears to no longer exist. Is this project (or a similar one) still on the web anywhere?

    Read the article

  • RDF-raptor-parser

    - by naveen
    Hi All, I am trying to parse the rdf file but I am getting error while executing following code in ubuntu RDF::Reader.open("http://datagraph.org/jhacker/foaf.rdf") do |reader| reader.each_statement do |statement| puts statement.inspect end end as LoadError: Could not open library 'libraptor': libraptor: cannot open shared object file: No such file or directory. Could not open library 'libraptor.so': libraptor.so: cannot open shared object file: No such file or directory I installed all the required gems: rdf rdf-raptor ffi rdf-json rdf-trix Please help me how to rectify this problem thanks in advance Naveenkumr.R

    Read the article

  • Objective-C DOM XML parser for iPhone

    - by phunehehe
    Hello guys I'm looking for a way on the iPhone to parse an XML document using DOM. I have been using SAX with NSXMLParser but now I really want a DOM tree (or anything that can quickly translate the XML document into an NSDictionary) Thanks for any help

    Read the article

  • Best 3rd Party Resume Parser Tool

    - by Krishna Kumar
    We are working on a hiring application and need the ability to easily parse resumes. Before trying to build one, was wondering what resume parsing tools are available out there and what is the best one, in your opinion? We need to be able to parse both Word and TXT files.

    Read the article

  • how to dispaly image in grid view reading imageUrl from xml using sax parser in android

    - by Pramod kuamr
    thanks for answer but i am able to read xml file from url but i need if in xml imageUrl is there so show in grid view ..this is my xml file and read URL <?xml version="1.0" encoding="UTF-8"?> <channels> <channel> <name>ndtv</name> <logo>http://a3.twimg.com/profile_images/670625317/aam-logo--twitter.png</logo> <description>this is a news Channel</description> <rssfeed>ndtv.com</rssfeed> </channel> <channel> <name>star news</name> <logo>http://a3.twimg.com/profile_images/740897825/AndroidCast-350_normal.png</logo> <description>this is a newsChannel</description> <rssfeed>starnews.com</rssfeed> </channel> </channels>

    Read the article

  • parser 2.1 and 2.2

    - by yaniv
    hi i using the follwing Code to retrive XML element text using getElementsByTagName this code success in 2.2 and Failed in 2.1 any idea ? URL metafeedUrl = new URL("http://x..../Y.xml") URLConnection connection ; connection= metafeedUrl.openConnection(); HttpURLConnection httpConnection = (HttpURLConnection)connection ; int resposnseCode= httpConnection.getResponseCode() ; if (resposnseCode == HttpURLConnection.HTTP_OK) { InputStream in = httpConnection.getInputStream(); DocumentBuilderFactory dbf ; dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); // Parse the Earthquakes entry Document dom = db.parse(in); Element docEle = dom.getDocumentElement(); //ArrayList<Album> Albums = new ArrayList<Album>(); /* Returns a NodeList of all descendant Elements with a given tag name, in document order.*/ NodeList nl = docEle.getElementsByTagName("entry"); if (nl!=null && nl.getLength() > 0) { for (int i = 0; i < nl.getLength(); i++) { Element entry = (Element)nl.item(i); /* Now on every property in Entry **/ Element title =(Element)entry.getElementsByTagName("title").item(0); *Here i Get an Error* String album_Title = title.getTextContent(); Element id =(Element)entry.getElementsByTagName("id").item(0); String album_id = id.getTextContent(); //

    Read the article

  • Where is a good Address Parser

    - by Brig Lamoreaux
    I'm looking for a good tool that can take a full mailing address, formatted for display or use with a mailing label, and convert it into a structured object. So for instance: // Start with a formatted address in a single string string f = "18698 E. Main Street\r\nBig Town, AZ, 86011"; // Parse into address Address addr = new Address(f); addr.Street; // 18698 E. Main Street addr.Locality; // Big Town addr.Region; // AZ addr.PostalCode; // 86011 Now I could do this using RegEx. But the tricky part is keeping it general enough to handle any address in the world! I'm sure there has to be something out there that can do it. If anyone noticed, this is actually the format of the opensocial.address object.

    Read the article

  • VB6 Parser/Lexer/Scripter

    - by rlb.usa
    I've got a game in VB6 and it works great and all, but I have been toying with the idea of creating a scripting engine. Ii'm thinking I'd like VB6 to read in flat text script files for me and then lex/parse/execute them. I have good programming experience, and I've built a simple C compiler, as well as a LOGO emulator before. My question is: Are there any tools that I can use, like Lexx/Yakk/Bison to help me? How should I approach this problem in regards to lexing, parsing, and feeding the commands back to VB6 so I can handle them? Is this idea a BAD IDEA in the sense that there are too many obstacles in the way (For example, building minesweeper in assembly, though not impossible, is very difficult, and a bad idea.)?

    Read the article

  • Robust DateTime parser library for .NET

    - by Frank Krueger
    Hello, I am writing an RSS and Mail reader app in C# (technically MonoTouch). I have run into the issue of parsing DateTimes. I see a lot of variance in how dates are presented in the wild and have begun writing a function like this: public static DateTime ParseTime(string timeStr) { var formats = new string[] { "ddd, d MMM yyyy H:mm:ss \"GMT+00:00\"", "d MMM yyyy H:mm:ss \"EST\"", "yyyy-MM-dd\"T\"HH:mm:ss\"Z\"", "ddd MMM d HH:mm:ss \"+0000\" yyyy", }; try { return DateTime.Parse(timeStr); } catch (Exception) { } foreach (var f in formats) { try { var t = DateTime.ParseExact(timeStr, f, CultureInfo.InvariantCulture); return t; } catch (Exception) { } } return DateTime.MinValue; } This, well, makes me sick. Three points. (1) It's silly of me to think that I can actually collect a format list that will cover everything out there. (2) It's wrong! Notice that I'm treating an EST date time as UTC (since .NET seems oblivious to time zones). (3) I don't like using exceptions for logic. I am looking for an existing library (source only please) that is known to handle a bunch of these formats. Also, I would like to keep using UTC DateTimes throughout my code so whatever library is suggested should be able to produce DateTimes. Is there anything out there like this?

    Read the article

  • Generic JSON parser in .NET / WPF?

    - by niklassaers
    I've read lots of tutorials on how to deserialize a JSON object to an object of a particular using DataContractJsonSerializer. However, I'd like to deserialize my object to a Dictionary consisting of either Strings, Arrays or Dictionaries, such as System.Json does with SilverLight when I say JsonObject.Parse(myJSONstring). Is there an equivalent to System.Json that I can use in my WPF project? (just a short background: I'm fetching JSON objects that have way to much info, and I just want to use a little bit to fill out a String array) Cheers Nik

    Read the article

  • VB.net XML Parser loop

    - by StealthRT
    Hey all i am new to XML parsing on VB.net. This is the code i am using to parse an XML file i have: Dim output As StringBuilder = New StringBuilder() Dim xmlString As String = _ "<ip_list>" & _ "<ip>" & _ "<ip>192.168.1.1</ip>" & _ "<ping>9 ms</ping>" & _ "<hostname>N/A</hostname>" & _ "</ip>" & _ "<ip>" & _ "<ip>192.168.1.6</ip>" & _ "<ping>0 ms</ping>" & _ "<hostname>N/A</hostname>" & _ "</ip>" & _ "</ip_list>" Using reader As XmlReader = XmlReader.Create(New StringReader(xmlString)) Do Until reader.EOF reader.ReadStartElement("ip_list") reader.ReadStartElement("ip") reader.ReadStartElement("ip") reader.MoveToFirstAttribute() Dim theIP As String = reader.Value.ToString reader.ReadToFollowing("ping") Dim thePing As String = reader.ReadElementContentAsString().ToString reader.ReadToFollowing("hostname") Dim theHN As String = reader.ReadElementContentAsString().ToString MsgBox(theIP & " " & thePing & " " & theHN) Loop End Using I put the "do until reader.EOF" myself but it does not seem to work. It keeps giving an error after the first go around. I must be missing something? David

    Read the article

  • Trouble parsing self closing XML tags using SAX parser

    - by sandesh
    Hi, I am having trouble parsing self closing XML tags using SAX. I am trying to extract the link tag from the Google Base API.I am having reasonable success in parsing regular tags. Here is a snippet of the xml <entry> <id>http://www.google.com/base/feeds/snippets/15802191394735287303</id> <published>2010-04-05T11:00:00.000Z</published> <updated>2010-04-24T19:00:07.000Z</updated> <category scheme='http://base.google.com/categories/itemtypes' term='Products'/> <title type='text'>En-el1 Li-ion Battery+charger For Nikon Digital Camera</title> <link rel='alternate' type='text/html' href='http://rover.ebay.com/rover/1/711-67261-24966-0/2?ipn=psmain&amp;icep_vectorid=263602&amp;kwid=1&amp;mtid=691&amp;crlp=1_263602&amp;icep_item_id=170468125748&amp;itemid=170468125748'/> . . and so on I can parse the updates and published tags, but not the link and category tag. Here is my startElement and endElement overrides public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals("title") && xmlTags.peek().equals("entry")) { insideEntryTitle = true; } xmlTags.push(qName); } public void endElement(String uri, String localName, String qName) throws SAXException { // If a "title" element is closed, we start a new line, to prepare // printing the new title. xmlTags.pop(); if (insideEntryTitle) { insideEntryTitle = false; System.out.println(); } } declaration for xmltags.. private Stack<String> xmlTags = new Stack<String>(); Any help guys? this is my first post here.. I hope I have followed posting rules! thanks a ton guys..

    Read the article

  • gcc c++ command line error-message parser

    - by Autopulated
    Are there any programs for parsing and displaying in a nice format the c++ error messages generated by gcc. I'm really looking for something like less that I can pipe my errors into that will collapse the template parameter lists by default, maybe with some nice highlighting so that my errors are actually readable. (Yes, it's boost's fault I have such incomprehensible errors, in case you were wondering)

    Read the article

  • javascript-aware html parser for Python ~

    - by znetor
    <html> <head> <script type="text/javascript"> document.write('<a href="http://www.google.com">f*** js</a>'); document.write("f*** js!"); </script> </head> <body> <script type="text/javascript"> document.write('<a href="http://www.google.com">f*** js</a>'); document.write("f*** js!"); </script> <div><a href="http://www.google.com">f*** js</a></div> </body> </html> I want use xpath to catch all lable object in the html page above... In [1]: import lxml.html as H In [2]: f = open("test.html","r") In [3]: c = f.read() In [4]: doc = H.document_fromstring(c) In [5]: doc.xpath('//a') Out[5]: [<Element a at a01d17c>] In [6]: a = doc.xpath('//a')[0] In [7]: a.getparent() Out[7]: <Element div at a01d41c> I only get one don't generate by js~ but firefox xpath checker can find all lable!? http://i.imgur.com/0hSug.png how to do that??? thx~! <html> <head> </head> <body> <script language="javascript"> function over(){ a.innerHTML="mouse me" } function out(){ a.innerHTML="<a href='http://www.google.com'>google</a>" } </script> <body><li id="a"onmouseover="over()" onmouseout="out()">mouse me</li> </body> </html>

    Read the article

  • [Android] XML Parser

    - by lemon
    I'm trying to extract n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs= using w3c dom <html> <div id='token' style='display:none;'> n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs= </div> </html> but I seem to be stuck DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(con.getInputStream()); NodeList list = doc.getElementsByTagName("div"); Can someone please point me to some basic tutorials that would help me solve my dilemma. Thanks.

    Read the article

  • json parser empty result

    - by graybow
    I'm new in gwt and new in using firebug.I have valid json result from tesdb3.php {"item": [{"kode":"002","nama":"bambang gentolet"}, {"kode":"012","nama":"Algiz"}]} I add the xml with inherits name='com.google.gwt.json.JSON'/ inherits name="com.google.gwt.http.HTTP" / then i try to show it in the gwt with this code. public class Tesdb3 implements EntryPoint { String url= "http://localhost/phpmyadmin/tesdb3/datauser.php"; public void LoadData() throws RequestException{ RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url)); builder.sendRequest(null, new RequestCallback(){ @Override public void onError(Request request, Throwable exception) { Window.alert("error " + exception); } public void onResponseReceived(Request request, Response response) { if (200 == response.getStatusCode()) { Window.alert("ok -" + response.getText() + "-" + response.getStatusCode()); } else { Window.alert("error2 -" + response.getText()+ response.getStatusText() + "-" + response.getStatusCode()); } } }); } public void onModuleLoad() { try { LoadData(); } catch (RequestException e) { e.printStackTrace(); } } } I run it in development mode. not hosted mode. My code didn't show any error. But the result in window alert is "error2 --OK-0". result Net from firebug is 7 request: get Tesdb3.html?gwt.codeserv = 200ok get Tesdb3.css = 200ok get tesdb3.nocache.js = 200ok get hosted.html?tesdb3 = aborted get standard.css = 304 not modified get hosted.html?tesdb3 = 403 not modified get datauser.php = 200ok my question is: Why the response status code is 0, and the response status text is 'OK'? there was no eror in json or java code. why response.getText is empty? Why i can't get any json result even a single character?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >