Search Results

Search found 3176 results on 128 pages for 'parsing'.

Page 86/128 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • XML generation error.

    - by Janis Peisenieks
    I'm trying to generate an XML output with Zend_Framework, but this nasty thing keeps popping up: XML Parsing Error: XML or text declaration not at start of entity Location: http://cart/index/kurpirkt Line Number 2, Column 1:<?xml version="1.0" encoding="utf-8"?> ^ As far as I know there are no white-spaces in any of my include files, and even if there were, I think that the ob_clean() function should have taken care of it. Here is my code: public function kurpirktAction() { ob_clean(); // XML-related routine $xml = new DOMDocument('1.0', 'utf-8'); $xml->appendChild($xml->createElement('foo', 'bar')); $output = $xml->saveXML(); // Both layout and view renderer should be disabled Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true); Zend_Layout::getMvcInstance()->disableLayout(); // Setting up headers and body $this->_response->setHeader('Content-Type', 'text/xml; charset=utf-8') ->setBody($output); } Any help or suggestions?

    Read the article

  • Does anyone know of a library in Java that can parse ESRI Shapefiles?

    - by KingNestor
    I'm interested in writing a visualization program for the road data in the 2009 Tiger/Line Shapefiles. I'd like to draw the line data to display all the roads for my county. The ESRI Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by ESRI as a (mostly) open specification for data interoperability among ESRI and other software products.1 A "shapefile" commonly refers to a collection of files with ".shp", ".shx", ".dbf", and other extensions on a common prefix name (e.g., "lakes.*"). The actual shapefile relates specifically to files with the ".shp" extension, however this file alone is incomplete for distribution, as the other supporting files are required. Does anyone know of existing libraries for parsing and reading in the line data for Shapefiles?

    Read the article

  • Repairing malformatted html attributes using c#

    - by jhoefnagels
    I have a web application with an upload functionality for HTML files generated by chess software to be able to include a javascript player that reproduces a chess game. I do not like to load the uploaded files in a frame so I reconstruct the HTML and javascript generated by the software by parsing the dynamic parts of the file. The problem with the HTML is that all attributes values are surrounded with an apostrophe instead of a quotation mark. I am looking for a way to fix this using a library or a regex replace using c#. The html looks like this: <DIV class='pgb'><TABLE class='pgbb' CELLSPACING='0' CELLPADDING='0'><TR><TD> and I would transform it into: <DIV class="pgb"><TABLE class="pgbb" CELLSPACING="0" CELLPADDING="0"><TR><TD>

    Read the article

  • Connecting to a WCF Service in PHP that has a a NetTCP Binding and a BasicHttpBinding

    - by Justin Dearing
    I have a WCF service. It has multiple clients and three endpoints. The endpoint bindings are nettcp, wsHttp and basicHttp. If I attempt to connect to it via php'd builtin SoapClient class like so: $service = new SoapClient ("http://service.companyname.local:6666/Service/?wsdl", array( "location" => "http://service.companyname.local:6666/Service/Basic", "trace" => true, 'soap_version' => SOAP_1_1 ) ); I get the following: PHP Fatal error: SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support transport 'http://schemas.microsoft.com/soap/tcp' in c:\www\client.php on line 666 Right now my workaround is to save the wsdl manually and remove the nettcp binding. Is there a workaround that will allow me to use the automatically generated wsdl? Can I hide a binding from the wsdl in web.config? Can I generate different wsdls on different bindings. I don't want to deploy two service hosts.

    Read the article

  • CMS Preventing Bad HTML Insertion by Client?

    - by Jascha
    I'm building a small CMS in PHP for a client and something I've noticed that comes up fairly often is a client will enter a bit of HTML in a field without closing his/her tag. I'm wondering if there is some parsing technique to prevent bad HTML from rendering my whole output page in italics because the user forgot to add a closing </i> tag. I'm not worried about XSS or malicious html, just a forgotten tag here and there as it's the client who is managing the content. Forgive me if this is a duplicate question, I did some searching, but could not find an appropriate answer. -J

    Read the article

  • How to remove default header from WCF REST Outgoing Response?

    - by bmsantos
    The following C# WCF based REST service gives me some undesired headers that I'm not sure if I can remove them trough the API. The interface: [ServiceContract] public interface IControlSystem { [OperationContract] [WebGet] System.IO.Stream About(); } The implementation: public class ControlSystem : IControlSystem { public System.IO.Stream About() { return new System.IO.MemoryStream(ASCIIEncoding.Default.GetBytes("Hello World")); } } Out of a raw socket connection it gives the following response: HTTP/1.1 200 OK Server: ASP.NET Development Server/9.0.0.0 Date: Tue, 15 Jun 2010 13:12:51 GMT X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: application/octet-stream Content-Length: 39 Connection: Close Hello World Question is, is it possible to get the server to not report anything other than the actual message? Need it in some calls so due to some small embedded device clients that will try to connect to the server and I would like to minimize the amount of parsing. Thanks, B.

    Read the article

  • Is there an HTML browser rendering engine for Ruby?

    - by Jose
    Given a URL, I would like to be able to render the returned HTML to know width and height for each div, fonts' size for each piece of text, color of each element, position of each element on screen, etc. A possible approach could be traversing the DOM tree with Hpricot and checking CSS style by parsing the associated stylesheet using css_parser gem. But this would not consider default styles, inheritance, floats, etc. In Java there's Cobra, a Java Web Renderer, which is able to render a web page and query attributes like width, font size, etc. for each fragment. I could use Cobra with JRuby or similar solutions, but prefer a Ruby native tool. Is there any library like this for Ruby?

    Read the article

  • java json/object to array

    - by heldopslippers
    Hi people. I have a question about type casting. I have the following json String: {"server":"clients","method":"whoIs","arguments":["hello"]} I am parsing it to the following Map< String, Object {arguments=[hello], method=whoIs, server=clients} It is now possible to do the following: request.get("arguments"); This works fine. But i need to get the array the is stored in the arguments. How can i accomplish this? I tried (for example) the following: System.out.println(request.get("arguments")[0]); But of course this doesn't work.. Does anybody know how this would be possible?

    Read the article

  • HTMLAgilityPack ChildNodes index works, named node does not

    - by XgenX
    I am parsing an XML API response with HTMLAgilityPack. I am able to select the result items from the API call. Then I loop through the items and want to write the ChildNodes to a table. When I select ChildNodes by saying something like: sItemId = dnItem.ChildNodes(0).innertext I get the proper itemId result. But when I try: sItemId = dnItem.ChildNodes("itemId").innertext I get "Referenced object has a value of 'Nothing'." I have tried "itemID[1]", "/itemId[1]" and a veriety of strings. I have tried SelectSingleNode and ChildNodes.Item("itemId").innertext. The only one that has worked is using the index. The problem with using the index is that sometimes child elements are omitted in the results and that throw off the index. Anybody know what I am doing wrong?

    Read the article

  • Parse error when trying to install app on Asus eee PC 701 running Android 2.0

    - by Don
    A beta tester of mine has a Asus eee pc 701 running Android 2.0 and he is trying to install an app on it from my web site. He is able to download the app but is getting a "Parse Error: There is a problem parsing the package" error. I don't really know if this problem is with the eee pc or with the apk since he is the first person to try to install it. I built it for 2.0, the manifest has 5 as the minimum API level and I used Eclipse to export and sign it. But this is my first Android app and he is the first to try to install it, so I am not sure what the problem might be? Could just be the Android implementation too. Here is a site about putting Android on the Asus: http://www.liliputing.com/2009/01/how-to-built-google-android-for-the-asus-eee-pc-701.html Any thoughts on what I might try to get this app installed on his machine?

    Read the article

  • How to pass a very long string/file into RESTWebservice JAX-RS Jersey

    - by Sashikiran Challa
    Hello All, I am trying to write a webservice that takes in an XML string, does parsing of it using DOM and extract particular things I want. My XML string happens to be very long so I do not want to pass it as a @QueryParam or @PathParam. Say If I write that XML string into a file, How do I go about writing a RESTful service that takes in this file, extracts whatever I want and return the results. I am actually trying to extract some number of strings, so my output should probably be an ArrayList having all these strings. Could somebody please shed some light on how I should go about doing this. Thanks in advance

    Read the article

  • Getting XML parse error in coldfusion. Can the packet returned be validated?

    - by jeff
    Getting an error on occasion on a specific CF page. Offending code listed below. Very odd because when I rebooted CF it went away. Can the XML be checked via XMLValidate to prevent this from happening? Is this some sort of CF bug since the error disappeared after reboot of CF? I have a feeling that the error will resurface at some point. An error occured while Parsing an XML document. The element type "meta" must be terminated by the matching end-tag "". <cfhttp method="get" url="http://bs.mysite.com/webservice/rec/get.sbs?customerId=345S4BE8x&itemId=#product_id#&number=20&ruleId=#product.location_tab_accessories#"> <cfset result = xmlParse(cfhttp.FileContent)> <cfset recs = xmlSearch(result, "/result/thsite/site/itemId")>

    Read the article

  • Scala: How to combine parser combinators from different objects

    - by eed3si9n
    Given a family of objects that implement parser combinators, how do I combine the parsers? Since Parsers.Parser is an inner class, and in Scala inner classes are bound to the outer object, the story becomes slightly complicated. Here's an example that attempts to combine two parsers from different objects. import scala.util.parsing.combinator._ class BinaryParser extends JavaTokenParsers { def anyrep: Parser[Any] = rep(any) def any: Parser[Any] = zero | one def zero: Parser[Any] = "0" def one: Parser[Any] = "1" } object LongChainParser extends BinaryParser { def parser1: Parser[Any] = zero~zero~one~one } object ShortChainParser extends BinaryParser { def parser2: Parser[Any] = zero~zero } object ExampleParser extends BinaryParser { def parser: Parser[Any] = (LongChainParser.parser1 ||| ShortChainParser.parser2) ~ anyrep def main(args: Array[String]) { println(parseAll(parser, args(0) )) } } This results to the following error: <console>:11: error: type mismatch; found : ShortChainParser.Parser[Any] required: LongChainParser.Parser[?] def parser: Parser[Any] = (LongChainParser.parser1 ||| ShortChainParser.parser2) ~ anyrep I've found the solution to this problem already, but since it was brought up recently on scala-user ML (Problem injecting one parser into another), it's probably worth putting it here too.

    Read the article

  • Creating a specialised view filtering form in Rails

    - by Schroedinger
    G'day guys, I have a current set of data, and I generate multiple analyses of this data (each analysis into its own active record item called a pricing_interval) using a helper function at the moment. Currently to analyse the set of data, you need a start time(using datetime_select) an integer (using text_field) and a name (using text_field) I would like on submission of the form to be redirected to the index page of my pricing_interval, as the values will be re-generated. Manually generating a range proves that my helper methods work. How would I build a form that on submit would send parameters to a function in the form of (date,integer,name) so that it could immediately begin work whilst redirecting the user to server/pricing_intervals Anything at all would help, I've spent hours over the past few days trying to get the rails form syntax working properly to no avail, a really straightforward guide to what I would implement to get this working would be amazingly appreciated. I've looked through the form guides, as I'm not creating an object, but merely parsing params, there's got to be an easy way to do this, right?

    Read the article

  • What parser generator do you recommend

    - by stefan.ciobaca
    I'm currently shopping for a FOSS parser generator for a project of mine. It has to support either C or C++. I've looked at bison/flex and at boost::spirit. I went from writing my own to spirit to bison to spirit to bison to spirit, each time hit by some feature I found unpleasant. The thing I hate most about bison/flex is that they actually generate C/C++ source for you. There are a number of disadvantages to this, e.g. debugging. I like spirit from this point of view, but I find it very very heavy on syntax. I am curious about what you are using, what you would recommend, and general thoughts about the state of the art in parser generators. I am also curious to hear about approaches being used in other languages for parsing problems.

    Read the article

  • chomsky hierarchy and programming languages

    - by dader51
    Hi, I'm trying to learn some aspects of the CH ( chomsky hierarchy ) which are related to PL ( programming languages ), and i still have to read the Dragon Book. I've read that most of the PL can be parsed as CFG ( context free grammar ). In term of computational power, it equals the one of a pushdown non deterministic automaton. Am I right ? If it's true, then how could a CFG holds a UG ( unrestricted grammar, which is turing complete ) ? I'm asking because, even if PL are CFG they are actually used to describe TM (turing machines ) and through UG. I think that's because of at least two different levels of computing, the first, which is the parsing of a CFG focuses on the syntax related to the structure ( representation ? ) of the language, while the other focuses on the semantic ( sense, interpretation of the data itself ? ) related to the capabilities of the pl which is turing complete. Again, are these assumptions rights ? thanx a lot.

    Read the article

  • SMO missing dll on a clients

    - by Dale
    I've created an app that connects remotely to SQL Server 2008. SQL connections work and all traditional oCommand.ExecuteNonQuery(), work great! But my SMO class using server.ConnectionContext.ExecuteNonQuery(scriptfile); ERROR: missing batch parsing.dll . I can't install these independent utils on a client machines, and then take them all off when done: as suggested by: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=228de03f-3b5a-428a-923f-58a033d316e1 Since my bulk-inserts are large memory hogs containing complete tables, I wrote the tables to a temptable.sql files and used SQLCMD Util and later switch too SMO and I have the same problem. Neither of these can be leveraged on the client's PCs . Any suggestion? thanks :-)

    Read the article

  • Iterate over enum?

    - by Rosarch
    I'm trying to iterate over an enum, and call a method using each of its values as a parameter. There has to be a better way to do it than what I have now: foreach (string gameObjectType in Enum.GetNames(typeof(GameObjectType))) { GameObjectType kind = (GameObjectType) Enum.Parse(typeof (GameObjectType), gameObjectType); IDictionary<string, string> gameObjectData = PersistentUtils.LoadGameObject(kind, persistentState); } //... public static IDictionary<string, string> LoadGameObject(GameObjectType gameObjectType, IPersistentState persistentState) { /* ... */ } Getting the enum names as strings, then parsing them back to enums, feels hideous.

    Read the article

  • Associating Worksheets with their Names using OpenXML SDK 1.0

    - by John Price
    I'm using version 1.0 of Microsoft's OpenXML SDK to do some basic parsing of .xlsx files. I can get and parse the worksheets, and I can get a list of worksheet names, but I cannot for the life of me figure out how to link up what name goes with what worksheet. I understand that an element like <sheet name="My Sheet" sheetId="1" r:id="rId1"/> in the workbook is linked up to a specific worksheet via the relationships defined in xl/_rels.xml, but I can't see where any of the relationship info is exposed in the API. I'm using C#, but any VB.NET examples would be just as helpful. I feel like this should be dead simple, but I can't figure it out. It also looks like it may be more straightforward in v2.0 of the SDK, but upgrading isn't an option at the moment.

    Read the article

  • NSString to NSData Failing in Encoding

    - by Travis
    I'm trying to use NSXmlParser to parse ISO-8859-1 data. Using Apple's own example for parsing ISO-8859-1, I have the following. NSString *xmlFilePath = [[NSBundle mainBundle] pathForResource:sampleFileName ofType:@"xml"]; NSString *xmlFileContents = [NSString stringWithContentsOfFile:xmlFilePath encoding:NSISOLatin1StringEncoding error:nil]; NSLog(@"contents: %@", xmlFileContents); I see that in the console, the contents of the string is accurate. However when I try to convert it to an NSData object (for use with the parser), I do the following. NSData *xmlData = [xmlFileContents dataUsingEncoding:NSISOLatin1StringEncoding]; But then when my didStartElement delegate gets called, I see  showing up which I think is from an encoding discrepancy. Can NSXmlParser handle ISO-8859-1 and if so, what am I doing wrong?

    Read the article

  • *** glibc detected *** perl: munmap_chunk(): invalid pointer

    - by sid_com
    At the and of a script-output (parsing a xhtml-site with XML::LibXML::Reader) I get this: * glibc detected * perl: munmap_chunk(): invalid pointer: 0x0000000000b362e0 * ======= Backtrace: ========= /lib64/libc.so.6[0x7fb84952fc76] /usr/lib64/libxml2.so.2[0x7fb848b75e17] /usr/lib64/libxml2.so.2(xmlHashFree+0xa6)[0x7fb848b691b6] ... ... ======= Memory map: ======== 00400000-0053d000 r-xp 00000000 08:01 182002 /usr/local/bin/perl 0073c000-0073d000 r--p 0013c000 08:01 182002 /usr/local/bin/perl 0073d000-00741000 rw-p 0013d000 08:01 182002 /usr/local/bin/perl 00741000-00c60000 rw-p 00000000 00:00 0 [heap] 7fb8482cd000-7fb8482e3000 r-xp 00000000 08:01 2404 /lib64/libgcc_s.so.1 ... ... Is this due a bug?

    Read the article

  • Unicode characters in URLs

    - by Pekka
    In 2010, would you serve URLs containing UTF-8 characters in a large web portal? Unicode characters are forbidden as per the RFC on URLs (see here). They would have to be percent encoded to be standards compliant. My main point, though, is serving the unencoded characters for the sole purpose of having nice-looking URLs, so percent encoding is out. All major browsers seem to be parsing those URLs okay no matter what the RFC says. My general impression, though, is that it gets very shaky when leaving the domain of web browsers: URLs getting copy+pasted into text files, E-Mails, even Web sites with a different encoding HTTP Client libraries Exotic browsers, RSS readers Is my impression correct that trouble is to be expected here, and thus it's not a practical solution (yet) if you're serving a non-technical audience and it's important that all your links work properly even if quoted and passed on? Is there some magic way of serving nice-looking URLs in HTML http://www.example.com/düsseldorf?neighbourhood=Lörick that can be copy+pasted with the special characters intact, but work correctly when re-used in older clients?

    Read the article

  • Using Kate with Simple Build Tool (SBT)

    - by Stefan
    Hello I am working with the Kate editor based on the lack of other good tools for Scala development, I am also using IntelliJ however it still has some bugs, and are slow enough to make me impatient. I have just startet using both Kate and SBT, and in that regard I have a little challenge I hope there is an answer for out there on "The Internet". I am using the standard "Build plugin" in Kate and has changed the commands from make to sbt. This works fine, and I am also getting a error report when the sbt fails during compile time. However I really wish to know if it is possible to integrate the compile errors into Kate such that it would be shown under "Errors and Warnings" instead of just in the output tab, where I have to do a manual search for the compile errors. Im guessing that it has something to do with the format of the output, if that is the case maybe it is "just" a smaller adjustment I need to make to the parsing language.

    Read the article

  • JDOM 1.1: hyphen is not a valid comment character

    - by Stefan Kendall
    I'm using tagsoup to clean some HTML I'm scraping from the internet, and I'm getting the following error when parsing through pages with comments: The data "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " is not legal for a JDOM comment: Comment data cannot start with a hyphen. I'm using JDOM 1.1, and here's the code that does the actual cleaning: SAXBuilder builder = new org.jdom.input.SAXBuilder("org.ccil.cowan.tagsoup.Parser"); // build // Don't check the doctype! At our usage rate, we'll get 503 responses // from the w3. builder.setEntityResolver(dummyEntityResolver); Reader in = new StringReader(str); org.jdom.Document doc = builder.build(in); String cleanXmlDoc = new org.jdom.output.XMLOutputter().outputString(doc); Any idea what's going wrong, or how to fix this? I need to be able to parse pages with long comment strings of <!--------- data ------------>

    Read the article

  • Which language/framework to use for this desktop internet application?

    - by Karsten
    I'd like to experiment with a new language/framework to work on some desktop tools for myself, which will do tasks related to internet services. I.e. i'd like to to monitor some of my servers for http or icmp response, also parse xml responses. I have experience with php, lua, mysql, and basic knowledge of java and c++. I'm also interested in exploring multithreading for this, background tasks and a responsive gui do need that as i have read. Being a private project, i certainly want to learn something new, but i don't have that much free time. The question for you would be which language and what framework to choose that could help me with this tasks: lightweight + fast gui (windows only would be ok, platform-independent even better) network/socket support, html module would be appreciated htmlview support xml "parsing" support (xpath or something like the phpish DOMDocument class) threading support Free software would be nice, but paying some bucks won't hurt me if it really helps the case.

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >