Giter Club home page Giter Club logo

xmldocument's Introduction

Overview

SMXMLDocument is a very handy lightweight XML parser for iOS.

In brief:

// create a new SMXMLDocument with the contents of sample.xml
SMXMLDocument *document = [SMXMLDocument documentWithData:data error:&error];

// Pull out the <books> node
SMXMLElement *books = [document.root childNamed:@"books"];

// Look through <books> children of type <book>
for (SMXMLElement *book in [books childrenNamed:@"book"]) {
  
  // demonstrate common cases of extracting XML data
  NSString *isbn = [book attributeNamed:@"isbn"]; // XML attribute
  NSString *title = [book valueWithPath:@"title"]; // child node value
  
  // show off some KVC magic
  NSArray *authors = [[book childNamed:@"authors"].children valueForKey:@"value"];
  
  // do interesting things...
}

More info in the blog post: http://nfarina.com/post/2843708636/a-lightweight-xml-parser-for-ios

ARC Support

Try the master_arc branch if your project has Automatic Reference Counting (ARC) enabled.

xmldocument's People

Contributors

nfarina avatar 0xced avatar

Watchers

Gustavo de Jesús Barrientos Guerrero avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.