XML in NSTableView using Cocoa Bindings
XML in NSTableView using Cocoa Bindings
- Subject: XML in NSTableView using Cocoa Bindings
- From: Paul Fitzgerald <email@hidden>
- Date: Fri, 1 Jul 2005 21:31:15 -0500
I've gone through the documentation located here:
http://developer.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/index.html
But I'm having a bit of trouble getting the XML data to display
properly in the NSTableView.
Here's my XML:
<customers>
<customer>
<name>John Doe</name>
<address>1234 Main Street</address>
<phone>123-456-7890</phone>
</customer>
<customer>
<name>Jane Doe</name>
<address>4321 Main Street</address>
<phone>234-567-8901</phone>
</customer>
</customers>
It is showing up in my NSTableView as:
Name | Address | Phone
John Doe1234 Main Street123-456-7890 | John Doe1234 Main
Street123-456-7890 | John Doe1234 Main Street123-456-7890
Jane Doe4321 Main Street234-567-8901 | Jane Doe4321 Main
Street234-567-8901 | Jane Doe4321 Main Street234-567-8901
I want it to show up as:
Name | Address | Phone
John Doe | 1234 Main Street | 123-456-7890
Jane Doe | 4321 Main Street | 234-567-8901
As you can see, I need the stringValue of the three child nodes of
each "customer" element to become the "columns" in the NSTableView,
but I can't figure out how to do that.
You can download the project at http://homepage.mac.com/pgfitzgerald/XMLTest.sit
You'll have to edit the code to set the proper path for the included XML file.
Thanks in advance,
Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden