NSXMLParser not getting all DTD information

2012-11-11 Thread Roland King
I have an NSXMLParser with a delegate which is just currently printing stuff out. I have an embedded DTD at the top of the xml I'm feeding it. Here are two of the implemented delegate methods -(void)parser:(NSXMLParser *)parser foundAttributeDeclarationWithName:(NSString *)attribut

Re: NSXMLParser thread safe?

2012-06-01 Thread Graham Cox
can still bite > you if the implication is that an NSXMLParser instance is safe to use from a > non-main thread as long as *all* uses are from the *same* thread. That would > make it unsafe to access the same NSXMLParser instance from two different > NSOperations. Right, thanks f

Re: NSXMLParser thread safe?

2012-06-01 Thread Joar Wingfors
On 1 jun 2012, at 18:15, Kyle Sluder wrote: > That would make it unsafe to access the same NSXMLParser instance from two > different NSOperations. Not necessarily. It all depends on the context of where the operations are executing.

Re: NSXMLParser thread safe?

2012-06-01 Thread Kyle Sluder
ich was easily dealt with using @synchronised blocks. It's important to note that operation queues (and dispatch queues for that matter) do not guarantee anything about what threads your operations execute on. Apple's notoriously slippery definition of "thread-safe" can still

Re: NSXMLParser thread safe?

2012-06-01 Thread Graham Cox
On 02/06/2012, at 1:55 AM, Nick Zitzmann wrote: > That depends. How are you creating the thread? It isn't difficult to do using > either the pthread or NSThread APIs. Well, I started with the NSThread method that I've used classically, but moved it over to using NSInvocationOperations in a NS

Re: NSXMLParser thread safe?

2012-06-01 Thread Nick Zitzmann
On May 31, 2012, at 11:36 PM, Graham Cox wrote: > I wonder if it's a stack space issue? I'm getting EXC_BAD_ACCESS with code 13 > - where are these codes listed? Is there a way to increase stack space for a > thread? That depends. How are you creating the thread? It isn't difficult to do using

Re: NSXMLParser thread safe?

2012-05-31 Thread Graham Cox
On 01/06/2012, at 1:50 PM, Ken Thomases wrote: > From the Lion release notes for Foundation: > > "NSXMLParser Thread Safety > > NSXMLParser is now threadsafe. However, it is not reentrant on a given > thread; don't call -parse on an NSXMLParser from within a del

Re: NSXMLParser thread safe?

2012-05-31 Thread Ken Thomases
On May 31, 2012, at 10:45 PM, Graham Cox wrote: > Just wondering if anyone knows whether NSXMLParser is thread safe. I'm using > it to parse SVG files - when I do it threaded, I get a crash in [NSXMLParser > parseData:], unthreaded it works fine. > > If I know it should b

NSXMLParser thread safe?

2012-05-31 Thread Graham Cox
Hi all, Just wondering if anyone knows whether NSXMLParser is thread safe. I'm using it to parse SVG files - when I do it threaded, I get a crash in [NSXMLParser parseData:], unthreaded it works fine. If I know it should be thread-safe, I can look to see whether anything in the par

Re: NSXMLParser and initWithStream

2012-05-31 Thread Fritz Anderson
On 31 May 2012, at 1:14 AM, John Drake wrote: > I figured out what the problem was and answering it here incase anyone else > runs into this problem in the future since +[NSXMLParser initWithStream] > doesn't have a lot lot of documentation out there. I needed to call > -[

RE: NSXMLParser and initWithStream

2012-05-30 Thread John Drake
I figured out what the problem was and answering it here incase anyone else runs into this problem in the future since +[NSXMLParser initWithStream] doesn't have a lot lot of documentation out there.  I needed to call -[NSXMLParser parse] right after I allocate NSXMLParser and set myse

RE: NSXMLParser and initWithStream

2012-05-28 Thread John Drake
I thought the same when I first read the documentation, and have tried not making ContentParser the delegate of the input stream as well as removing the call to -[NSXMLParser parse], however I still don't see any of the NSXMLParser delegates being called. I'm wondering if it's a

Re: NSXMLParser and initWithStream

2012-05-28 Thread Fritz Anderson
On 27 May 2012, at 7:14 PM, John Drake wrote: > Looking at the documentation for NSXMLParser, it seems like the > initWithStream: method to initialize a NSXMLParser would be the perfect > solution to my problem. I can initialize the parser with a NSInputStream and > then call the

NSXMLParser and initWithStream

2012-05-27 Thread John Drake
I'm trying to use the NSStream classes to parse incoming incremental XML data. The data is never a complete XML Document, but I want to receive and process it in incremental chunks based off how much ever the socket can read. Looking at the documentation for NSXMLParser, it seems lik

Re: NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Thomas Davie
On 22 Jan 2012, at 18:45, Jens Alfke wrote: > > On Jan 22, 2012, at 5:15 AM, Thomas Davie wrote: > >> As you can see, none of that is in my code (beyond main), so I have a real >> problem debugging what's going on here. > > Cocoa debugging tip: A crash in objc_msgsend almost always implies a

Re: NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Jens Alfke
On Jan 22, 2012, at 5:15 AM, Thomas Davie wrote: > As you can see, none of that is in my code (beyond main), so I have a real > problem debugging what's going on here. Cocoa debugging tip: A crash in objc_msgsend almost always implies a dangling reference to a deallocated object. Usually the

Re: NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Thomas Davie
Thanks Andreas, I am indeed using ARC, so the code should be safe enough, as ARC will retain rec for me. Cheers for taking a look though Tom Davie if (*ra4 != 0xffc78948) { return false; } On 22 Jan 2012, at 13:35, Andreas Grosam wrote: > > On Jan 22, 2012, at 2:15 PM, Thomas Davie wrote: >>

Re: NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Andreas Grosam
On Jan 22, 2012, at 2:15 PM, Thomas Davie wrote: >OSPConnection *rec = [[self connectionQueue] objectAtIndex:0]; >[[self connectionQueue] removeObjectAtIndex:0]; >[[self currentConnections] addObject:rec]; Not sure if this is related to your issue, but basical

NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Thomas Davie
oundPairRead () > #70x012ab744 in CFReadStreamRead () > #80x0133f69f in -[__NSCFInputStream read:maxLength:] () > #9 0x00d82da6 in -[NSXMLParser parseFromStream] () > #10 0x00d82e2a in -[NSXMLParser parse] () > #11 0xea99 in __34-[OSPMapServer popConnectionQueue]_blo

Re: Noob question in regards to NSXMLParser

2011-06-07 Thread Jens Alfke
On Jun 7, 2011, at 11:41 AM, Chris Ridd wrote: > You might want to check out the GDataXMLDocument class, as it is a drop-in > (exact?) replacement for NSXMLDocument except it supports namespaces properly > in XPath expressions. Ooooh, that’s nice to know. I’ve had some really frustrating times

Re: Noob question in regards to NSXMLParser

2011-06-07 Thread Chris Ridd
On 7 Jun 2011, at 19:11, Eric E. Dolecki wrote: > This is for iOS. I've used XPath in other languages and it's totally > awesome. So I am using some flags and a counter to get things done... feels > like a total hack, but it's working. > > Sorry, I'll specify in the future for sure... You might

Re: Noob question in regards to NSXMLParser

2011-06-07 Thread Eric E. Dolecki
really worth it (you can find online tutorials pretty > easily by searching.) > > So instead of NSXMLParser, use the higher level NSXMLDocument (which can > even fetch the URL for you) and then use the XPath methods on it. > > [Um, except now it occurs to me that you didn’t spe

Re: Noob question in regards to NSXMLParser

2011-06-07 Thread Jens Alfke
or is a one-liner. There is a little bit of a learning curve for learning the syntax, but it’s really worth it (you can find online tutorials pretty easily by searching.) So instead of NSXMLParser, use the higher level NSXMLDocument (which can even fetch the URL for you) and then use the XPath m

Re: Noob question in regards to NSXMLParser

2011-06-07 Thread Eric E. Dolecki
I went with the first solution and it works well enough for me. Anything beyond this simple XML and I think I'd likely use a 3rd-party solution. Thanks for the suggestion! Google Voice: (508) 656-0622 Twitter: eric_dolecki XBoxLive: edolecki PSN: eric_dolecki http://blog.ericd.n

Re: Noob question in regards to NSXMLParser

2011-06-07 Thread Hank Heijink (Mailinglists)
Two ways that I've used: 1. Keep a boolean isInCurrentConditions that you set when you start the current_conditions element and reset when you end that element. Then every time you enter a condition element you check the boolean to see if you are where you need to be in the hierarchy. This work

Noob question in regards to NSXMLParser

2011-06-07 Thread Eric E. Dolecki
I am fetching some XML weather from Google: ... What I am really after is the current_conditions data. How can one specify WHERE in the XML to use the attributes from? A lot of the information is repeated in other nodes so I can't just check (if([elementName isEqualToString:@

NSXMLParser and entity resolving (OS X 10.6.6)

2011-03-04 Thread Greg Anderson
After spending a good deal of time with Uncle Google and some of his friends, I still have unanswered problems using NSXMLParser with an XML file that has entities in it. It appears that most of my questions have been asked over the last few years, but I haven't found any postings

NSXMLParser chokes on DTD declaration

2010-11-28 Thread Ross Carter
If I use NSXMLParser (on 10.6.5) to parse xml data that looks like this: [elements omitted] and if I have sent the parser a setShouldResolveExternalEntities:YES message, I would expect the parser delegate message parser:resolveExternalEntityName:systemID: to fire, as described

Re: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-09 Thread Jerry Krinock
Thank you all for the replies. On 2010 Jul 08, at 19:18, Jeff Johnson wrote: > See section 3.3.3 Attribute-Value Normalization: > > http://www.xml.com/axml/testaxml.htm That's the problem. NSXMLParser is correct. Unfortunately, the incorrect XML is being generated by other

Re: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread John Joyce
>> >> >> >> >> wherein there is a linefeed (0x0a) followed by two spaces between the >> command and "California". The accented é is represented by two bytes, 0xa3 >> 0xc9. It's all nice UTF-8, as indicated in the header. >> &g

Re: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread Jeff Johnson
wed by two spaces between the command > and "California". The accented é is represented by two bytes, 0xa3 0xc9. > It's all nice UTF-8, as indicated in the header. > > When I parse this using NSXMLParser, the value for the key "location" in the > attribu

Re: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread Steve Bird
It's all nice UTF-8, as indicated in the header. > > When I parse this using NSXMLParser, the value for the key "location" in the > attributes dictionary comes out as: > > San José, California > > wherein there are three spaces (0x20) between the comma and "

NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread Jerry Krinock
Consider this XML: wherein there is a linefeed (0x0a) followed by two spaces between the command and "California". The accented é is represented by two bytes, 0xa3 0xc9. It's all nice UTF-8, as indicated in the header. When I parse this using NSXMLParser, the va

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Scott Anguish
On May 21, 2010, at 1:52 PM, Patrick Rutkowski wrote: > When docs are bad, and I'm frustrated, I might throw out a mild pejorative; > it's a reflex, sorry :-/ > You were warned by an Apple employee (David Duncan) that your tone wasn’t going to get you help. Behavior on the list is expected

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
On May 21, 2010, at 1:29 PM, David Duncan wrote: > On May 21, 2010, at 10:23 AM, Patrick Rutkowski wrote: > >> Any API that accepts binary data needs to give at least a hint as to what >> format the binary data should be. Saying that just it accepts "data" is >> disgusting. Period, end of argu

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
On May 21, 2010, at 1:31 PM, Kyle Sluder wrote: > On Fri, May 21, 2010 at 10:23 AM, Patrick Rutkowski > wrote: >> Milder tone? No thanks. > > Awfully strong words from someone who waltzes onto a mailing list, > lambastes the documentation, and admits in the very next sentence he > has no idea

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Gary L. Wade
orgetting to document it, but if you want to say (as >>> you seem to be doing) that it's OK to consciously leave it out, then you're >>> just a moron. >>> >>> -Patrick >>> >>> On May 21, 2010, at 1:07 PM, Kyle Sluder wrote: >>

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
;m not saying that you're a >> moron for accidentally forgetting to document it, but if you want to say (as >> you seem to be doing) that it's OK to consciously leave it out, then you're >> just a moron. >> >> -Patrick >> >> On May 21, 2010,

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 10:23 AM, Patrick Rutkowski wrote: > Milder tone? No thanks. Awfully strong words from someone who waltzes onto a mailing list, lambastes the documentation, and admits in the very next sentence he has no idea what he's talking about. > > Any API that accepts binary data n

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread David Duncan
On May 21, 2010, at 10:23 AM, Patrick Rutkowski wrote: > Any API that accepts binary data needs to give at least a hint as to what > format the binary data should be. Saying that just it accepts "data" is > disgusting. Period, end of argument. The problem is that XML specifies the text encoding

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
moron. -Patrick On May 21, 2010, at 1:07 PM, Kyle Sluder wrote: > On Fri, May 21, 2010 at 9:39 AM, Patrick Rutkowski wrote: >> I find it disgusting that the doc section for NSXMLParser initWithData takes >> binary data, but doesn't tell you which encoding it's supposed t

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 9:39 AM, Patrick Rutkowski wrote: > I find it disgusting that the doc section for NSXMLParser initWithData takes > binary data, but doesn't tell you which encoding it's supposed to be? > > Link: > http://developer.apple.com/mac/library/docu

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Keary Suska
On May 21, 2010, at 10:39 AM, Patrick Rutkowski wrote: > I find it disgusting that the doc section for NSXMLParser initWithData takes > binary data, but doesn't tell you which encoding it's supposed to be? > > Link: > http://developer.apple.com/mac/library/docu

NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
I find it disgusting that the doc section for NSXMLParser initWithData takes binary data, but doesn't tell you which encoding it's supposed to be? Link: http://developer.apple.com/mac/library/documentation/cocoa/reference/foundation/Classes/NSXMLParser_Class/Reference/Reference.html#/

Re: program termination after releasing self defined NSXMLParser class

2010-04-18 Thread Alexander Spohr
terms for XML parsing, "event-driven" parsing, provided by > NSXMLParser, means that the parser yields elements one-by-one as it steps > through the source. You'll note from the paragraph after the one you quote > that -[NSXMLParser parse] returns "YES if parsing is s

Re: program termination after releasing self defined NSXMLParser class

2010-04-17 Thread Fritz Anderson
On 17 Apr 2010, at 11:44 AM, Fritz Anderson wrote: > I have not found this to be the case. In the context of the documents, and of > the customary terms for XML parsing, "event-driven" parsing, provided by > NSXMLParser, means that the parser yields elements one-by-one as

Re: program termination after releasing self defined NSXMLParser class

2010-04-17 Thread Fritz Anderson
- > you released it right after it started to work. > > You have to retain it as long as the parsing takes. That is what the delegate > is for. I have not found this to be the case. In the context of the documents, and of the customary terms for XML parsing, "event-driven"

Re: program termination after releasing self defined NSXMLParser class

2010-04-17 Thread Dominic Dauer
Ok. It works. Instead of subclassing NSXMLParser I created my own Class with implementation of the NSXMLParserDelegate Protocol. I create a NSXMLParser object and set the delegate to an created object of my subclassed NSXMLParserDelegate. > Whenever I hear this from a programmer, I cri

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Roland King
Nice try Kyle but that bug is still outstanding with apple as open and I maintain that the UITextField doesn't respond to the method it's sending its delegate and the hang in that case, if we're talking about the same case, is due to a different interaction. It may be that having self as delegat

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Kyle Sluder
On Fri, Apr 16, 2010 at 9:25 AM, Jens Alfke wrote: > That’s true in general, but in this case he’s setting the parser’s delegate > to itself. Which is weird, but should mean that the object can’t possibly > outlive the delegate :) Well there's yer problem! :D The first step is not making an obje

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Alexander Spohr
Am 16.04.2010 um 00:43 schrieb Dominic Dauer: > With the purpose to test these simple class I just did the following in the > controller class of one view: > > -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField { > > XMLParser *parser = [[XMLParser alloc] initWithContentsOfURL:[

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Jens Alfke
On Apr 16, 2010, at 8:53 AM, Kyle Sluder wrote: > Ross is probably right. You need to nil out weak references before releasing > things. Since you don't know if the NSXMLParser is going to live beyond your > releasing it, you don't know if it's going to later try messa

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Kyle Sluder
he following message: Program received signal: “EXC_BAD_ACCESS”. #0 0x93e0bedb in objc_msgSend () #1 0x in ?? () Ross is probably right. You need to nil out weak references before releasing things. Since you don't know if the NSXMLParser is going to live beyond your releasing i

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Jens Alfke
On Apr 16, 2010, at 2:58 AM, Dominic Dauer wrote: > After I entered bt or backtrace I got the following message: > > Program received signal: “EXC_BAD_ACCESS”. > #0 0x93e0bedb in objc_msgSend () > #1 0x in ?? () > > This is all. OK, that means the stack got corrupted before the cra

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Ross Carter
On Apr 16, 2010, at 5:58 AM, Dominic Dauer wrote: > Ok. Sorry for that. I never worked with the debugger. > After I entered bt or backtrace I got the following message: > > Program received signal: “EXC_BAD_ACCESS”. > #0 0x93e0bedb in objc_msgSend () > #1 0x in ?? () > Just a wild g

Re: program termination after releasing self defined NSXMLParser class

2010-04-16 Thread Dominic Dauer
Ok. Sorry for that. I never worked with the debugger. After I entered bt or backtrace I got the following message: Program received signal: “EXC_BAD_ACCESS”. #0 0x93e0bedb in objc_msgSend () #1 0x in ?? () This is all. Dominic ___ Cocoa-

Re: program termination after releasing self defined NSXMLParser class

2010-04-15 Thread Jens Alfke
On Apr 15, 2010, at 10:39 PM, Dominic Dauer wrote: > The debugger shows this: > > Program received signal: “EXC_BAD_ACCESS” Yes, but what functions are on the stack? (They show up in a list, and also you can type “bt” at the gdb prompt to get a textual list.) —Jens_

Re: program termination after releasing self defined NSXMLParser class

2010-04-15 Thread Dominic Dauer
On 16.04.2010, at 01:45, Jens Alfke wrote: > Run the app with the debugger and it should tell you where it's crashing. > That may help pin it down. The debugger shows this: Program received signal: “EXC_BAD_ACCESS” Dominic ___ Cocoa-dev ma

Re: program termination after releasing self defined NSXMLParser class

2010-04-15 Thread Jens Alfke
x27;s crashing. That may help pin it down. I don't see anything obviously wrong, although subclassing NSXMLParser and setting it to be its own delegate seems weird — the purpose of a delegate mechanism is so you don't have to subclass; you can instead implement the delegate

program termination after releasing self defined NSXMLParser class

2010-04-15 Thread Dominic Dauer
Hi all, I am writing on an app for the iPhone/iPod which parses a xml Document to display the data in table views. I want to ask something fundamental. I created my own class of NSXMLParser: - XMLParser.h #import @interface

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
an Objective C Wrapper. http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html Regards, I can see you have already got two recommendation for using other lib and wrapper and some for fixing your NSXMLParser delegate issue, Answering your original question: #1 Yahoo! api will alw

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Peter Blazejewicz
I can see you have already got two recommendation for using other lib and wrapper and some for fixing your NSXMLParser delegate issue, Answering your original question: #1 Yahoo! api will always return only two days in forecast: day for which current forecast was released (not necessary today

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Philip Vallone
Hi. I would recommend LibXML. This post is excellent and the the author created an Objective C Wrapper. http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html Regards, On Jan 6, 2010, at 2:28 PM, Eric E. Dolecki wrote: > This is what I am doing now that feels like a hack (

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
This is what I am doing now that feels like a hack (I only ever get a 2 day forecast, the one for today is the first): if( [elementName isEqualToString:@"yweather:forecast"]){ NSString *tmpDay = [attributeDict valueForKey:@"day"]; NSDate *now = [NSDate date]; NSDateFormatter *formatter = [[NSDa

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Jeremy Pereira
On 6 Jan 2010, at 18:13, Eric E. Dolecki wrote: > Well okay yes... same element name but I need to tell them apart. The day attribute has a different value in each case though. Just pull out the the object with the key @"day" from the attribute dictionary. > > On Wed, Jan 6, 2010 at 1:07 PM,

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
Well okay yes... same element name but I need to tell them apart. On Wed, Jan 6, 2010 at 1:07 PM, Jeremy Pereira wrote: > > On 6 Jan 2010, at 16:22, Eric E. Dolecki wrote: > > > I am fetching weather data & in my results I am getting today and > tomorrow's > > forecasts. However they have the sam

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Jeremy Pereira
On 6 Jan 2010, at 16:22, Eric E. Dolecki wrote: > I am fetching weather data & in my results I am getting today and tomorrow's > forecasts. However they have the same node: > > > > > How can I get at those separately in my didStartElement? Is there a way to > turn that into an array or someth

NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
I am fetching weather data & in my results I am getting today and tomorrow's forecasts. However they have the same node: How can I get at those separately in my didStartElement? Is there a way to turn that into an array or something? ___ Cocoa-dev ma

Re: iPhone: NSXMLParser problems

2010-01-06 Thread Jeremy Pereira
> > +(NSString*)getWeatherXmlForZipCode: (NSString*)zipCode { + means class method > NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; > [parser setDelegate:self]; self in a class method is the class itself. > > - (void)parser:(NSX

Re: iPhone: NSXMLParser problems

2010-01-06 Thread Eric E. Dolecki
> >> aren't firing at all - so I don't think it's a namespace issue. Does the > >> code seem okay? > >> > >> If I dump the stringReply into a UIWebView it renders it fine. I just > want > >> to pull out current conditions

Re: iPhone: NSXMLParser problems

2010-01-06 Thread Chaitanya Pandit
the image (gif) to display in a >> UIImageView... >> >> >> >> On Tue, Jan 5, 2010 at 6:38 AM, Jeremy Pereira wrote: >> >>> >>> On 5 Jan 2010, at 05:09, Eric E. Dolecki wrote: >>> >>>> >>>> - (void)parser:

Re: iPhone: NSXMLParser problems

2010-01-05 Thread Eric E. Dolecki
> On Tue, Jan 5, 2010 at 6:38 AM, Jeremy Pereira wrote: > >> >> On 5 Jan 2010, at 05:09, Eric E. Dolecki wrote: >> >> > >> > - (void)parser:(NSXMLParser *)parser didStartElement:(NSString >> *)elementName >> > namespaceURI:(NSString *)names

Re: iPhone: NSXMLParser problems

2010-01-05 Thread Eric E. Dolecki
If I dump the stringReply into a UIWebView it renders it fine. I just want to pull out current conditions and get the image (gif) to display in a UIImageView... On Tue, Jan 5, 2010 at 6:38 AM, Jeremy Pereira wrote: > > On 5 Jan 2010, at 05:09, Eric E. Dolecki wrote: > > >

Re: iPhone: NSXMLParser problems

2010-01-05 Thread Jeremy Pereira
On 5 Jan 2010, at 05:09, Eric E. Dolecki wrote: > > - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName > namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName > attributes:(NSDictionary *)attributeDict { > > NSLog(@"didStartEle

iPhone: NSXMLParser problems

2010-01-04 Thread Eric E. Dolecki
really a weird bastardization of XML and HTML: - (void)parserDidStartDocument:(NSXMLParser *)parser { NSLog(@"parserDidStartDocument"); } - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError { NSLog(@"Parsing Error"); } - (void)parser:(NSXMLParser

Re: Normalizing text in elements from NSXMLParser

2009-12-19 Thread Jerry Krinock
On 2009 Dec 19, at 05:50, Charles Burnstagger wrote: > I retrieve some text from elements found in XML I parse using NSXMLParser on > iPhone. The text contains special characters such as #x92;s instead of 's. > > I've tried all the normalization routines on NSString but n

Normalizing text in elements from NSXMLParser

2009-12-19 Thread Charles Burnstagger
I retrieve some text from elements found in XML I parse using NSXMLParser on iPhone. The text contains special characters such as #x92;s instead of 's. I've tried all the normalization routines on NSString but none of them work on the special characters. Is there anyway in Cocoa to di

Re: NSXMLParser choking on single quotes

2009-11-13 Thread Ken Tozier
On Nov 12, 2009, at 11:04 AM, Matt Neuburg wrote: On Thu, 12 Nov 2009 12:08:20 + (UTC), kentoz...@comcast.net said: I'm using NSXMLParser to parse XML output from Microsoft Word and am finding that if a string contains a single quote, the parser is only giving me the part of the s

Re: NSXMLParser choking on single quotes

2009-11-12 Thread Matt Neuburg
On Thu, 12 Nov 2009 12:08:20 + (UTC), kentoz...@comcast.net said: >I'm using NSXMLParser to parse XML output from Microsoft Word and am finding that if a string contains a single quote, the parser is only giving me the part of the string from the single quote onward. For example g

NSXMLParser choking on single quotes

2009-11-12 Thread kentozier
Hi I'm using NSXMLParser to parse XML output from Microsoft Word and am finding that if a string contains a single quote, the parser is only giving me the part of the string from the single quote onward. For example given the following string: "The topic of Jim's discus

Re: NSOperationQueue for NSXMLParser object

2009-11-05 Thread Marcel Weiher
because of downloading, as -[NSXMLParser initWithURL:] will download the entire XML file first and then start parsing it. I've determined that I'll need to do the parsing on a separate thread from the main thread (Unless there is a better solution?). Yes. There are two likely so

Re: NSOperationQueue for NSXMLParser object

2009-11-05 Thread Ken Thomases
On Nov 5, 2009, at 8:12 PM, Chris Purcell wrote: //Parse the XML - (void) parseXML:(NSTimer *)timer { XMLParser *parser = [[XMLParser alloc] initWithURL:@"Location of the XML" delegate:self]; [queue addOperation:parser]; [parser release]; //th

NSOperationQueue for NSXMLParser object

2009-11-05 Thread Chris Purcell
Let me start with what I'm trying to accomplish. I have an app that is constantly running an animation, which's attributes are determined after downloading and parsing some XML. The XML is parsed at a given interval using an NSTimer. As expected, sometimes when the XML is being parsed th

Re: NSDate / NSXMLParser

2009-11-04 Thread David Rowland
On Nov 4, 2009, at 2:48 AM, Alexander Spohr wrote: The parser CAN parse the timezone and adjust the date accordingly. To parse this date: 20091021T121942+0200 I use this format: MMdd'T'HHmmssZZZ and it works fine. The only thing you need is to find the right timezone format string. Yours

Re: NSDate / NSXMLParser

2009-11-04 Thread David Rowland
On Nov 4, 2009, at 1:49 AM, Ingvar Nedrebo wrote: The easiest way is to set the timezone on the formatter: [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; Yes! That works. I'm sure I tried it, but I must have misinterpreted the results. _

Re: NSDate / NSXMLParser

2009-11-04 Thread Alexander Spohr
The parser CAN parse the timezone and adjust the date accordingly. To parse this date: 20091021T121942+0200 I use this format: MMdd'T'HHmmssZZZ and it works fine. The only thing you need is to find the right timezone format string. Yours might be '-'MM'-'dd'T'HH':'mm':'ssZ Not sure if yo

Re: NSDate / NSXMLParser

2009-11-04 Thread Ingvar Nedrebo
The easiest way is to set the timezone on the formatter: [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; On Nov 3, 2009, at 21:54, David Rowland wrote: Thanks to all for this useful discussion. I think I have solved my problem by taking the data from the parser as is an

Re: NSDate / NSXMLParser

2009-11-03 Thread Nick Zitzmann
On Nov 3, 2009, at 1:15 PM, David Rowland wrote: It still gets the hours right but tags the time zone as -0800 (Pacific). If you're basing that off of the description of the NSDate, then of course it does; NSDate objects have no knowledge of time zones, so the description shows the date

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
On Nov 3, 2009, at 10:04 AM, Chunk 1978 wrote: have you tried it on your device? Yes. The device and the Simulator behave the same way. On Tue, Nov 3, 2009 at 11:26 AM, David Rowland wrote: The SeismicXML sample code uses NSXMLParser to extract data from a file downloaded from the

Re: NSDate / NSXMLParser

2009-11-03 Thread Kyle Sluder
On Tue, Nov 3, 2009 at 12:56 PM, David Rowland wrote: > But NSDate does have a knowledge of time zones. The reason I am doing this > it to do some arithmetic on the dates - like this, No, it does not. NSDate refers to a point in time ("seven seconds after the big bang"), not to how anyone might

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
Thanks to all for this useful discussion. I think I have solved my problem by taking the data from the parser as is and then applying a correction for my offset from GMT when I do my arithmetic. Like this, int offset = [[NSTimeZone localTimeZone] secondsFromGMT]; NSDate *today = [NSDate d

Re: NSDate / NSXMLParser

2009-11-03 Thread Nick Zitzmann
On Nov 3, 2009, at 1:56 PM, David Rowland wrote: In this code "today" gets created correctly. The display shows current Pacific hours and an offset of -0800. Of course it does. NSDate objects are always displayed as if they were in your local time zone; it just prints the time zone in the

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
On Nov 3, 2009, at 12:19 PM, Nick Zitzmann wrote: On Nov 3, 2009, at 1:15 PM, David Rowland wrote: It still gets the hours right but tags the time zone as -0800 (Pacific). If you're basing that off of the description of the NSDate, then of course it does; NSDate objects have no knowledg

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
On Nov 3, 2009, at 10:37 AM, Nick Zitzmann wrote: On Nov 3, 2009, at 9:26 AM, David Rowland wrote: No doubt my inexperience with the parser or NSDate is at fault. How do I get the parser to recognize that the time really is UTC? If you're using NSDateFormatter, you set the time zone by se

Re: NSDate / NSXMLParser

2009-11-03 Thread Nick Zitzmann
On Nov 3, 2009, at 9:26 AM, David Rowland wrote: No doubt my inexperience with the parser or NSDate is at fault. How do I get the parser to recognize that the time really is UTC? If you're using NSDateFormatter, you set the time zone by setting the formatter's calendar with an NSCalendar w

NSDate / NSXMLParser

2009-11-03 Thread David Rowland
The SeismicXML sample code uses NSXMLParser to extract data from a file downloaded from the USGS. The time of an event appears in the file like this, .12:34:32Z According to rfc 822 'Z' means UTC (or GMT if you prefer). I find that the NSDate from the parser is tagged a

Re: NSDate / NSXMLParser

2009-11-03 Thread Chunk 1978
have you tried it on your device? On Tue, Nov 3, 2009 at 11:26 AM, David Rowland wrote: > The SeismicXML sample code uses NSXMLParser to extract data from a file > downloaded from the USGS. The time of an event appears in the file like > this, > .12:34:32Z > > Accor

Re: Parsing question about NSXMLParser

2009-07-01 Thread Fritz Anderson
On 1 Jul 2009, at 3:49 PM, Erg Consultant wrote: I am trying to parse an XML file on the web using NSXMLParser. The page is a list of gold prices. I can get the tagged elements with no problem, but the price item doesn't seem to be tagged. Can anyone tell me how to get the price it

Parsing question about NSXMLParser

2009-07-01 Thread Erg Consultant
I am trying to parse an XML file on the web using NSXMLParser. The page is a list of gold prices. I can get the tagged elements with no problem, but the price item doesn't seem to be tagged. Can anyone tell me how to get the price item in this element using NSXMLParser: 95.2086 Thanks,

Re: NSXMLParser - howto resolve entities defined in DTD

2009-06-01 Thread Keary Suska
On Jun 1, 2009, at 4:03 PM, Keary Suska wrote: All external entities must be declared in the core XML. If they aren't, your XML is not well-formed. Correction, this would not be the case for declarations in a DTD, which are part of the external subset, so the first delegate message should

  1   2   >