Questions tagged [nsxmldocument]

An instance of NSXMLDocument represents an XML document as internalized into a logical tree structure. An NSXMLDocument object can have multiple child nodes but only one element, the root element. Any other node must be a NSXMLNode object representing a comment or a processing instruction.

40 questions
5
votes
3 answers

Unable to #import

I am going to use NSXMLElement in my project, so I tried to #import but it gives an error: "No such file or directory." How can I include this?
Aravindhan
  • 15,608
  • 10
  • 56
  • 71
4
votes
3 answers

NSXMLDocument, nodesForXPath with namespaces

I want to get a set of elements from a xml-file, but as soon the the elements involve namespaces, it fails. This is a fragment of the xml file:
Vegar
  • 12,828
  • 16
  • 85
  • 151
4
votes
3 answers

NSXMLElement with solo tag . ie.

I'm trying to create a XML string which should contain solo tags (ie. tag without separate closing tags) I am able to create normal xml tags like using the code NSXMLElement *childElement=[[NSXMLElement…
Renjith
  • 83
  • 1
  • 7
3
votes
1 answer

can NSTreeController setcontent be used with NSXMLDocument?

I'm trying to display the content of a simple plist (xml) file in an outlineview. Once I have the file data in either an NSXMLDocument or an NSDictionary, is it possible to just use this existing structure to populate the TreeController? All the…
3
votes
2 answers

NSXMLDocument, search with nodesForXPath:

I need to search through an HTML document for two specific strings of text in cocoa. I am creating an NSXMLDocument with the web page: Page Example Then I am trying to search it for the app title, and the url of the icon. I am currently using this…
Brandon Mcq
  • 575
  • 2
  • 10
  • 24
3
votes
2 answers

NSXMLDocument error with opening file

I am trying to read a file into NSXMLDocument. Here my code: NSString *urlString = [@"~/Library/Preferences/Quark/QuarkXPress 8/OutputStyles.xml" stringByExpandingTildeInPath]; urlString = [urlString…
user635064
  • 6,219
  • 12
  • 54
  • 100
3
votes
1 answer

NSXMLDocument not has in Cocoa Touch

I create XML file successful but it not contains first line : This code is : xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:url options:NSXMLDocumentTidyXML error:&error]; if(xmlDoc) { …
HTKT611
  • 161
  • 1
  • 1
  • 11
2
votes
1 answer

Cocoa XML reader app

I'm a newbie to Cocoa, just develop some little apps with C/C++ on Windows. I want to make a "simple" app on Cocoa. When the user specific XML file, the file nodes are represented "enduser viewable". I made an interface with some NSTextField. I made…
Nono
  • 241
  • 5
  • 15
2
votes
1 answer

How to generate an XML document in iOS using objective-c

I want to generate an XML document in iOS. My primary goal is to generate it using inbuilt classes/libraries. I researched a lot and I found that NSXMLElement, NSXMLDocument etc are used to generate XML in OS X but not in iOS (correct me if I'm…
iOS dev
  • 470
  • 7
  • 23
2
votes
0 answers

NSXMLDocument family: Runs of whitespace collapsed to one

I’m parsing some XML (the document.xml payload of an MS-Word .docx if that matters) for which I need scrupulously-correct character offsets. I’m using Cocoa (OS X)’s NSXMLDocument family for tree parsing. I’ve solved most of the problems, except…
Fritz Anderson
  • 409
  • 4
  • 14
2
votes
0 answers

how to write to XML file in objective c cocoa

m new to xcode and objective c cocoa framework and i want to write xml data to xml file placed in my cocoa project but i want that once i created xml file and when i closes application and open it again to create xml file then it does not overwrite…
mano
  • 85
  • 1
  • 3
  • 17
2
votes
1 answer

Collecting NSXMLDocument warning output

I have the following helper function for transforming XML via XSLT: - (NSXMLDocument *)transform:(NSString *)xml :(NSString *)xslt { NSError *xmlDocErr = nil; NSXMLDocument *transformedXmlDoc = nil; NSXMLDocument *xmlDoc =…
ABach
  • 3,743
  • 5
  • 25
  • 33
1
vote
3 answers

Manipulating HTML

I need to read a HTML file and search for some tags in it. Based on the results, some tags would need to be removed, other ones changed and maybe refining some attributes — to then write the file back. Is NSXMLDocument the way to go? I don't think…
sidyll
  • 57,726
  • 14
  • 108
  • 151
1
vote
3 answers

Objective-C [[NSXMLDocument alloc] initWithContentsOfURL:url options:0 error:&error]; help

I need a little help, i have a search field and button which trigger this method but i get the error underneath. - (IBAction)fetchTracks:(id)sender { NSString *input = [searchField stringValue]; NSString *searchString = [input…
Sami
  • 1,374
  • 1
  • 16
  • 43
1
vote
0 answers

Add a new NSXMLElement to an existing NSXMLDocument

I have following NSXMLDocument: 1234 Now I would like to add another NSXMLElement directly behind the first…
3ef9g
  • 781
  • 2
  • 9
  • 19
1
2 3