On Jul 15, 2009, at 7:53 PM, Maxwell, Adam R wrote: > On 07/15/09 10:35, "Christiaan Hofman" <cmhof...@gmail.com> wrote: > >> >> On Jul 15, 2009, at 7:25 PM, Maxwell, Adam R wrote: >> >>> On 07/15/09 09:21, "Adam R Maxwell" <adam.maxw...@pnl.gov> wrote: >>> >>>> NSXMLDocumentTidyXML|NSXMLNodePreserveAll might do it (omitting the >>>> NSXMLDocumentTidyHTML conversion). It certainly produces a >>>> different-looking document, but I'm not exactly sure what span >>>> element to >>>> look for... >>> >>> Never mind; I found the span elements, and they are preserved by >>> this >>> combination of options. Your code for using Xpath seems to work >>> if you use >>> >>> if ([NSString isEmptyString:title] == NO) >>> [dataArray addObject:[node XMLString]]; >> >> Shouldn't that be the title attribute? Though it's not really clear >> to me how >> the parser works. > > You're right; I think it should look like this: > > while (node = [nodeEnum nextObject]) { > if ([node kind] == NSXMLElementKind && [node > attributeForName:@"title"] != nil) > [dataArray addObject:[[node attributeForName:@"title"] > XMLString]]; > } >
Somehow I can't get that to work. It finds the nodes, but can't parse them. Christiaan > The main thing is to feed it the XML string. > >>> in +Z3988MatchesForDocument:. I'm not sure what the implications >>> are of >>> leaving out NSXMLDocumentTidyHTML for other parsers. >> >> That's the problem I have with this, it certainly sounds like the >> wrong thing >> to do. > > I don't see another option, since TidyHTML evidently removes empty > elements > as part of its XHTML conversion process. I added a fallback case to > TidyHTML in case TidyXML fails, so I'll see what happens. ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Bibdesk-develop mailing list Bibdesk-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-develop