Ji (戟) is an XML/HTML parser for Swift

Related tags

XML & HTML Ji
Overview

Ji: a Swift XML/HTML parser

Ji 戟

CI Status CocoaPods Version Carthage Compatible License Platform

Ji (戟) is a Swift wrapper on libxml2 for parsing XML/HTML.

Features

  • Build XML/HTML Tree and Navigate.
  • XPath Query Supported.
  • Comprehensive Unit Test Coverage.
  • Support Swift Package Manager (SPM). Linux compatible.

Requirements

  • iOS 8.0+ / Mac OS X 10.9+ / watchOS 2.0+ / tvOS 9.0+
  • Xcode 8.0+

Installation

CocoaPods

To integrate Ji into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!

pod 'Ji', '~> 5.0.0'

Then, run the following command:

$ pod install

Carthage

To integrate Ji into your Xcode project using Carthage, specify it in your Cartfile:

github "honghaoz/Ji" ~> 5.0.0

Swift Package Manager (SPM)

Prerequisites

  • OSX
brew install libxml2
brew link --force libxml2
  • Linux
$ sudo apt-get install libxml2-dev

Update Package.swift

To integrate Ji in your project, add the proper description to your Package.swift file:

// swift-tools-version:5.0
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/honghaoz/Ji.git", from: "5.0.0")
    ],
    targets: [
        .target(
            name: "YOUR_TARGET_NAME",
            dependencies: ["Ji"]
        ),
        ...
    ]
)

Manually

If you prefer not to use a dependency manager, you can integrate Ji into your project manually.

  • Add sources into your project:

    • Drag Ji.swift, JiHelper.swift and JiNode.swift in Sources/Ji folder into your project.
    • Drag Sources/Clibxml2 folder into your project.
  • Configure your project:

    • Open project, select the target, under Build Settings, in Header Search Paths, add $(SDKROOT)/usr/include/libxml2
    • Under Build Settings, in Import Paths, add $(SRCROOT)/Clibxml2 (Make sure this is the path to the Clibxml2 folder)

Usage

If you are using CocoaPods to integrate Ji. Import Ji first:

import Ji
  • Init with URL:
let jiDoc = Ji(htmlURL: URL(string: "http://www.apple.com/support")!)
let titleNode = jiDoc?.xPath("//head/title")?.first
print("title: \(String(describing: titleNode?.content))") // title: Optional("Official Apple Support")
  • Init with String:
let xmlString = "<?xml version='1.0' encoding='UTF-8'?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>"
let jiDoc = Ji(xmlString: xmlString)
let bodyNode = jiDoc?.rootNode?.firstChildWithName("body")
print("body: \(String(describing: bodyNode?.content))") // body: Optional("Don\'t forget me this weekend!")
  • Init with Data:
let googleIndexData = try? Data(contentsOf: URL(string: "http://www.google.com")!)
if let googleIndexData = googleIndexData {
    let jiDoc = Ji(htmlData: googleIndexData)!
    let htmlNode = jiDoc.rootNode!
    print("html tagName: \(String(describing: htmlNode.tagName))") // html tagName: Optional("html")

    let aNodes = jiDoc.xPath("//body//a")
    if let firstANode = aNodes?.first {
        print("first a node tagName: \(String(describing: firstANode.name))") // first a node tagName: Optional("a")
        let href = firstANode["href"]
        print("first a node href: \(String(describing: href))") // first a node href: Optional("http://www.google.ca/imghp?hl=en&tab=wi")
    }
} else {
    print("google.com is inaccessible")
}

let 戟文档 = (htmlURL: URL(string: "https://cocoapods.org/pods/Ji")!)
let attribution = 戟文档?.xPath("//ul[@class='attribution']")?.first
print("作者(Author): \(String(describing: attribution?.content))") // 作者(Author): Optional("ByHonghao Zhang")

License

The MIT License (MIT)

Copyright (c) 2019 Honghao Zhang (张宏昊)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found. CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.4'

    Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found. CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.4'

    Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found.
    CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 8.4'
    

    Any ideas?

    opened by Pezhin 9
  • Swift 4, iOS 11, and Xcode 9

    Swift 4, iOS 11, and Xcode 9

    I'm persistently getting the error:

    XPath error : Invalid predicate XPath error : Invalid expression

    During build time for a project on iOS 11, Xcode 9, and Swift 4

    opened by HackShitUp 8
  • Include of non-modular header-error

    Include of non-modular header-error

    I get an Include of non-modular header inside framework module 'Ji.*' when downloading Ji via Cocoapods.

    All headers are public though, which should fix that... but it doesn't.

    These happen on all Ji-includes in these headers.

    opened by BasThomas 8
  • 有些特定xpath不能解析

    有些特定xpath不能解析

        let contentData = NSData(contentsOfURL: NSURL(string: "http://v2ex.com/t/223195")!)
        let jiDoc = Ji(htmlData: contentData!)
        let nodes = jiDoc?.xPath("//div[starts-with(@id, 'r_')]")
    

    是想解析里面含r_ 的div,用chrome 的xpath helper 可以将里面帖子全部解析出来,但是如果用Ji来解析 话,nodes没有结果。

    看了下hpple也有这个问题,是什么原因?

    opened by yudun1989 8
  • 发现一个bug

    发现一个bug

    发现一个bug:

    <div>
      <a href="a1">
        <img src="img1">
      </a>
    
      <a href="a2">
        <img src="img2">
      </a>
    
      <a href="a3">
        <img src="img3">
      </a>
    </div>
    

    通过xPath拿到一个Node列表,然后遍历这个列表,调用每个Node的xPath方法:

    let nodes = Ji.xPath("//div/a")
    
    for node in nodes {
        let test1 = node.xPath("img")
        let test2 = node.xPath("//img")
    }
    

    照道理说test2的内容 应该等于test1的,因为现在xPath搜索的环境是node的html中,都只有一个,但是test2把全文的img都检索出来了。

    opened by zixun 8
  • 有没有方法只解析本级别的content,不解析下级的content

    有没有方法只解析本级别的content,不解析下级的content

    Hi, 晚上好, 在解析时,预想只解析本级别的content,有没有方便的实现办法, html字符串如下: jiissue 代码如下: let elements = JiDocument.xPath("//a")?.first?.content 调试输出如下: 3742c6f3-4280-4eeb-87c3-36a349d8d4b8

    问题:本次解析时,我只想得到 "新闻" 这个content,不希望下级的2267也解析出来。

    新手,请多指教, 感谢!🙏

    opened by jiti1000 6
  • Carthage support?

    Carthage support?

    Hi, I really love this project! Thank you so very much for building it.

    Is there a chance though that you could support installing via Carthage as well? Cocoapods is great, no question, but Carthage is pretty cool as well and a staggering amount of great projects already support both giving the users an option of how to integrate with their project.

    Thanks for considering 😊

    opened by kiliankoe 5
  • 有關解析 HTML

    有關解析 HTML

    你好,我在使用 Ji 時,遇到了點問題.. 我的 HTML CODE 如下:

    <!doctype html>
    <html lang="en" prefix="op: http://media.facebook.com/op#">
      <head>
        <meta charset="utf-8">
        <link rel="canonical" href="http://life.tw/?app=view&no=431445">
        <link rel="stylesheet" title="Lifetw" href="#">
        <meta property="fb:article_style" content="Lifetw">
        <title>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</title>
      </head>
      <body>
      <article>
              <header>
        <figure>
        <img src="http://images.900.tw/upload_file/33/content/dc38a115-5732-b707-34d2-83513508a273.jpg">
        <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
        </figure>
    
        <h2> 可愛的兔兔應該是繼汪星人和喵星人之外比較常見的家庭寵物,而在日本就有一隻垂耳兔PuiPui不只本身擁有超萌的高顏值,她的主人也很用心地幫PuiPui準備專屬服裝,並且在Instagram上分享牠的變裝... </h2>
    
    
        <address>
          Styletc樂時尚    </address>
    
        <time class="op-published" dateTime="2016-05-11T09:15:25+08:00">Wed, 11 May 2016 09:15:25 +0800</time>
        <time class="op-modified" dateTime="2016-05-11T09:15:25+08:00">Wed, 11 May 2016 09:15:25 +0800</time>
        </header>    
        <p>可愛的兔兔應該是繼汪星人和喵星人之外比較常見的家庭寵物,而在日本就有一隻垂耳兔PuiPui不只本身擁有超萌的高顏值,她的主人也很用心地幫PuiPui準備專屬服裝,並且在Instagram上分享牠的變裝日記,讓PuiPui成為超多粉絲追蹤的人氣時尚潮兔,快一起來認識PuiPui吧!</p>
    
    <figure>
      <img src="http://images.900.tw/upload_file/33/content/dc38a115-5732-b707-34d2-83513508a273.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼穿上可愛的學生制服、萌兔PuiPui要在櫻花的目送下上學去啦!</p>
    <a href="http://www.styletc.com/wp-content/uploads/2016/05/110.jpg">
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/110.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    </a>
    
    <p>▼到了秋天就換上福爾摩斯裝來襯托深沉的秋意!</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/28.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼萬聖節這個最重要的變裝日子當然要穿上可愛的巫師裝!</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/36.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼PuiPui的毛絨絨可愛模樣為什麼會這麼適合英國軍人裝啊~</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/46.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼地表最萌的聖誕小精靈,可以請聖誕老公公送一隻這樣的小精靈給我嗎?</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/53.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼雖然是會融化人心的可愛外表,但穿上了正式的日式傳統衣服也意外地有堂堂男子漢的氣息啊</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/61.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼我不只是主人捧在手掌心疼的小兔兔,也是我們家的國王喔(威顏貌)</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/71.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼穿上帥帥的水手服到公園進行偷親女朋友計畫成功!</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/81.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼夏天到冰店打工就是要一身清爽的夏日浴衣才可以~</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/9.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼主人:「要乖乖的戴好帽子帥帥的出門喔!」</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/101.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼為了搭配世界盃主題來場足球員cosplay好了,但也不要小看兔兔的靈敏度啊!</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/111.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼穿上全套英國紳士西裝之後根本就是個一秒奪取女心的寮妹高手!</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/121.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼今天的扮裝重點是&hellip;&hellip;加班中的上班族?!</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/131.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼來檢查一下主人拍我的照片成果如何?</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/141.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>▼嗯&hellip;&hellip;今天到底該穿哪一件呢(苦惱中)</p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/151.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>還想看更多萌兔PuiPui的穿搭日記嗎?那就快來追蹤「mumitan」這個Instagram帳號&gt;&gt;&gt;<a href="https://www.instagram.com/mumitan/">https://www.instagram.com/mumitan/</a></p>
    
    <figure>
      <img src="http://www.styletc.com/wp-content/uploads/2016/05/161.jpg" />
      <figcaption>哥什麼造型都能消化!超卡哇伊又高顏值的萌兔PuiPui穿搭日記圖集...第12張簡直是撩妹高手呀!</figcaption>
    </figure>
    
    
    <p>看更多&gt;&gt;&gt;</p>
    <p><a href="http://www.styletc.com/archives/129688">毛小孩也要開萬聖趴,寵物變裝造型靈感大集合!</a></p>
    <p><a href="http://www.styletc.com/archives/229939">背面萌度x2,快來追蹤柯基屁屁Instagram帳號!</a></p>
    <p><a href="http://www.styletc.com/archives/220203">《管教惡貓》主持人傑克森蓋勒克西獨家馭貓術大公開</a></p>
    
    <p>圖片來源:<a href="https://www.instagram.com/mumitan/">mumitan&nbsp;Instagram</a></p>
    
    <p>【<a href="http://www.styletc.com/archives/233782" target="_blank">本文出處</a>,更多精采內容請上《<a class="navbar-link" href="http://www.styletc.com/">Styletc樂時尚</a>》官方網站;《<a class="navbar-link" href="https://www.facebook.com/pages/Styletc%E6%A8%82%E6%99%82%E5%B0%9A/1436316026651285?fref=ts">Styletc樂時尚</a>》官方粉絲團。未經授權,請勿轉載!】</p>
    <figure class="op-ad">
    <iframe src="http://fbarticle.life.tw/dfp.html" height="280" width="336"></iframe>
    </figure>
            <footer>
        <aside>
          Life Talk copyright© 2011 ALL ACCESS HOLDING GROUP LTD., All rights reserved. 客服專線:0800-090-789
        </aside>
        <small>© Life生活網</small>
      </footer>  </article>
      </body>
    </html>
    

    我想去Parse 每一個 'p', 'figure.img', 'figure.figcaption' .. 等 試了好多方式,好像都只能單獨取一個 tag 而已..@@?

    不知是否我的寫法有誤:

      let elements = jiDoc!.xPath("//p")!
    
                let count = elements.count
                for i in 0..<count {
                    let x = elements[i].rawContent
                    debugPrint("x : \(x)")
                }
    
    
    opened by ilyi1116 4
  • GBK编码的HTML字符串初始化Ji后里面的内容全乱码了

    GBK编码的HTML字符串初始化Ji后里面的内容全乱码了

    网页是GBK编码的,然后我这样初始化Ji

     let NSGBKStringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringEncoding(CFStringEncodings.GB_18030_2000.rawValue))
     var htmlString = String(data: data!, encoding: NSGBKStringEncoding)
     let ji = Ji(htmlString: htmlString!, encoding: NSGBKStringEncoding)
    

    我这样转换后ji里的内容中文的全乱码了,不知道为什么

    网站是梦幻西游论坛:http://my.netease.com/forum.php

    opened by zixun 4
  • Invalid XPath

    Invalid XPath

    Hello, when using an XPath like this:

    guard let jiHTML = Ji(htmlString: html) else {
         dispatchGroup.leave()
         return
    }
    guard let scoreboxNodes = jiHTML.xPath("//div[@class='new-score-box-wrapper']") else {
          dispatchGroup.leave()
          return
    }
    

    I get an invalid predicate error. The path that i have given is valid. I also tried switching to the swift4 branch but that didn't work either.

    opened by SwiftyGuerrero 3
  • function Ji(htmlURL: NSURL) return nil

    function Ji(htmlURL: NSURL) return nil

    Hi @honghaoz I can read with any website, but this website always return nil let jiDoc = Ji(htmlURL: NSURL(string: "http://michayaa.seesaa.net/")!) Are you have any idea about this case?

    Waiting for feedback 
    opened by havudk1707 3
  • SPM 模拟器中运行很好,真机构建报错

    SPM 模拟器中运行很好,真机构建报错

    ld: warning: ignoring file /usr/local/Cellar/libxml2/2.9.10_1/lib/libxml2.dylib, building for iOS-arm64 but attempting to link with file built for macOS-x86_64
    
    Undefined symbols for architecture arm64:
    
    Undefined symbol: _xmlXPathCmpNodes
    Undefined symbol: _xmlXPathEvalExpression
    
    opened by i-tengfei 0
  • Undefined symbols

    Undefined symbols

    Hi there,

    I'm newbie in Swift and for now I am facing this kind of issue. I tried various solutions which I found on StackOverflow, but errors did not disappeared. I have no idea what's going on, maybe something with imported settings. Please, can you give me some advice?

    Thanks!

    Snímka obrazovky 2019-12-20 o 22 09 31
    opened by PeHk 1
  • gbk error

    gbk error "encoding error : input conversion failed due to input error"(swift3)

    let data = try? Data(contentsOf: URL(string: "http://m.263xs.com/info-83441/")!)		
    let gbk = CFStringConvertEncodingToNSStringEncoding(CFStringEncoding(CFStringEncodings.GB_18030_2000.rawValue))
    let string = String(data: data!, encoding: String.Encoding(rawValue: gbk)) // **it's OK!**
    let doc = Ji(data: data, encoding: String.Encoding(rawValue: gbk), isXML: false) // **it show error: "encoding error : input conversion failed due to input error"**
    
    opened by foolbear 5
  • xPath fails if there's xmlns

    xPath fails if there's xmlns

    Evaluating XPath strings fails if one of the elements is defined with XML namespace. Most of the frameworks offer a method to register namespaces but I found no way for Ji. So I guess many of the common XML/HTML files can't be queried by your xPath function.

    enhancement 
    opened by kschroeer 2
Releases(5.1.0)
Owner
HongHao Zhang
🔨
HongHao Zhang
Kanna(鉋) is an XML/HTML parser for Swift.

Kanna(鉋) Kanna(鉋) is an XML/HTML parser for cross-platform(macOS, iOS, tvOS, watchOS and Linux!). It was inspired by Nokogiri(鋸). ℹ️ Documentation Fea

Atsushi Kiwaki 2.3k Dec 31, 2022
A sensible way to deal with XML & HTML for iOS & macOS

Ono (斧) Foundation lacks a convenient, cross-platform way to work with HTML and XML. NSXMLParser is an event-driven, SAX-style API that can be cumbers

Mattt 2.6k Dec 14, 2022
Simple XML Parser implemented in Swift

Simple XML Parser implemented in Swift What's this? This is a XML parser inspired by SwiftyJSON and SWXMLHash. NSXMLParser in Foundation framework is

Yahoo! JAPAN 531 Jan 1, 2023
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)

SwiftSoup is a pure Swift library, cross-platform (macOS, iOS, tvOS, watchOS and Linux!), for working with real-world HTML. It provides a very conveni

Nabil Chatbi 3.7k Jan 6, 2023
Swift minion for simple and lightweight XML parsing

AEXML Swift minion for simple and lightweight XML parsing I made this for personal use, but feel free to use it or contribute. For more examples check

Marko Tadić 975 Dec 26, 2022
CheatyXML is a Swift framework designed to manage XML easily

CheatyXML CheatyXML is a Swift framework designed to manage XML easily. Requirements iOS 8.0 or later tvOS 9.0 or later Installation Cocoapods If you'

Louis Bodart 24 Mar 31, 2022
The most swifty way to deal with XML data in swift 5.

SwiftyXML SwiftyXML use most swifty way to deal with XML data. Features Infinity subscript dynamicMemberLookup Support (use $ started string to subscr

Kevin 99 Sep 6, 2022
Simple XML parsing in Swift

SWXMLHash SWXMLHash is a relatively simple way to parse XML in Swift. If you're familiar with NSXMLParser, this library is a simple wrapper around it.

David Mohundro 1.3k Jan 3, 2023
Easy XML parsing using Codable protocols in Swift

XMLCoder Encoder & Decoder for XML using Swift's Codable protocols. This package is a fork of the original ShawnMoore/XMLParsing with more features an

Max Desiatov 657 Dec 30, 2022
A simple way to map XML to Objects written in Swift

XMLMapper XMLMapper is a framework written in Swift that makes it easy for you to convert your model objects (classes and structs) to and from XML. Ex

Giorgos Charitakis 109 Jan 6, 2023
Generate styled SwiftUI Text from strings with XML tags.

XMLText is a mini library that can generate SwiftUI Text from a given XML string with tags. It uses AttributedString to compose the final text output.

null 15 Dec 7, 2022
Fetch a XML feed and parse it into objects

AlamofireXmlToObjects ?? This is now a subspec of EVReflection and the code is maintained there. ?? You can install it as a subspec like this: use_fra

Edwin Vermeer 65 Dec 29, 2020
📄 A Swift DSL for writing type-safe HTML/CSS in SwiftUI way

?? swift-web-page (swep) Swep is a Swift DSL for writing type-safe HTML/CSS in SwiftUI way. Table of Contents Motivation Examples Safety Design FAQ In

Abdullah Aljahdali 14 Dec 31, 2022
Swift package to convert a HTML table into an array of dictionaries.

Swift package to convert a HTML table into an array of dictionaries.

null 1 Jun 18, 2022
Mongrel is a Swift and HTML hybrid with a bit of support for CSS and Javascript.

Mongrel is a Swift and HTML hybrid with a bit of support for CSS and Javascript. Using a declaritive style of programming, Mongrel makes writing HTML feel natural and easy. Mongrel also uses a SwiftUI like body structure allowing structs to be completely dedicated as an HTML page or element.

Nicholas Bellucci 12 Sep 22, 2022
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Pavel Sharanda 1.1k Dec 26, 2022
An Objective-C framework for your everyday HTML needs.

HTMLKit An Objective-C framework for your everyday HTML needs. Quick Overview Installation Parsing The DOM CSS3 Selectors Quick Overview HTMLKit is a

Iskandar Abudiab 229 Dec 12, 2022
Mathias Köhnke 1.1k Dec 16, 2022
Ji (戟) is an XML/HTML parser for Swift

Ji 戟 Ji (戟) is a Swift wrapper on libxml2 for parsing XML/HTML. Features Build XML/HTML Tree and Navigate. XPath Query Supported. Comprehensive Unit T

HongHao Zhang 824 Dec 15, 2022
Kanna(鉋) is an XML/HTML parser for Swift.

Kanna(鉋) Kanna(鉋) is an XML/HTML parser for cross-platform(macOS, iOS, tvOS, watchOS and Linux!). It was inspired by Nokogiri(鋸). ℹ️ Documentation Fea

Atsushi Kiwaki 2.3k Dec 31, 2022