Swiftpack.co -  stefanspringer1/SwiftXMLParser as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
An XML parser written in Swift
.package(url: "https://github.com/stefanspringer1/SwiftXMLParser.git", from: "0.1.57")


About This Library

This is a non-validating parser for XML files encoding in UTF-8.

This library is published under the Apache License 2.0, please feel free to use it and change it. Any remark or suggestion or pull requests are welcome, see also my contact information on my website.

Important Notes

  • This library comes without any warranty.
  • This is only a first version of the library, it may have some serious bugs at the moment or change significantly in the near future.
  • The active repository will move to a new place. The new place will then be noted here.

Main Aspects of This Parser

Entities that are not understood as external entities according to the internal subset of the document (they are then called "internal" entities here)can be replaced by the client. Internal entities in attribute values have to be replaced by the client, internal attributes in text might remain. This entity handling can be added by the client in form of a trailing closure to the parse call, receiving the entity name and the optional names of the element and the attribute, if the entity is from an attribute value.

Besides entity handling, the client uses the parser by an instance of type "XMLEventHandler" defined in the (XMLInterfaces)[https://github.com/stefanspringer1/XMLInterfaces] repository.

Some Limitations of This Parser

  • It only parses XML docmuments encoded in UTF-8.
  • it understands document type declaration and entity declarations, but does not do any validation against a DTD (or any other scheme) and does not read any external files.
  • It parses element declarations ("") and attribute list declarations ("") only in the form of its definition as text, it does not uses them for valöidation, and no enttites within them are replaced.


More documentation will be added (if the active repository is not moved yet, see abobe), either in this README file or as code comments.


Stars: 0
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Related Packages

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics