Reputation: 11
I want to parse this file in Cocoa Application.but no parser for xml work well.Please help for parsing this file or other xml files like this. Thanks... My Xml File is as Under:
Hiren
<property id=\"license\">
<object>
<property id=\"color\">
<string>red</string>
</property>
<property id=\"expiresOn\">
<string>10-10-2010</string>
</property>
<property id=\"Note\">
<string>This licence is valid to <[email protected]> until 10-10-2010</string>
</property>
</object>
</Property>
Upvotes: 1
Views: 260
Reputation: 96323
I want to parse this file in Cocoa Application.but no parser for xml work well.
The parsers work fine. Your input is broken; it isn't valid XML.
There are two things wrong with it:
string
element within the property#Note
element contains unescaped angle brackets.Your input is broken; therefore, you cannot parse it as XML. If you want to parse XML, you need valid XML to parse.
Upvotes: 4
Reputation: 1922
Have you considered using the DOM? A quick Google search shows that Apple's libraries provide a DOM implementation. Then it's just a matter of finding the right Element and calling getAttribute
on it to find the values of the various attributes.
Upvotes: 0