{"id":14069097,"url":"https://github.com/r-lib/xml2","last_synced_at":"2025-05-15T16:02:57.384Z","repository":{"id":27248062,"uuid":"30720200","full_name":"r-lib/xml2","owner":"r-lib","description":"Bindings to libxml2","archived":false,"fork":false,"pushed_at":"2025-03-14T21:23:27.000Z","size":14948,"stargazers_count":221,"open_issues_count":62,"forks_count":83,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-15T08:24:13.150Z","etag":null,"topics":["libxml2","r","xml"],"latest_commit_sha":null,"homepage":"https://xml2.r-lib.org/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-02-12T19:43:52.000Z","updated_at":"2025-05-12T20:09:22.000Z","dependencies_parsed_at":"2022-07-08T10:43:59.211Z","dependency_job_id":"1ea3df25-b205-4dcb-b98d-718cff317bcb","html_url":"https://github.com/r-lib/xml2","commit_stats":{"total_commits":768,"total_committers":38,"mean_commits":"20.210526315789473","dds":0.40625,"last_synced_commit":"ab73051bca962d3cbcf8f4046eb2758be74a489c"},"previous_names":["hadley/xml2"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fxml2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fxml2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fxml2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fxml2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/xml2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374398,"owners_count":22060609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libxml2","r","xml"],"created_at":"2024-08-13T07:06:36.296Z","updated_at":"2025-05-15T16:02:57.333Z","avatar_url":"https://github.com/r-lib.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# xml2\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/xml2)](https://cran.r-project.org/package=xml2)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/xml2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/r-lib/xml2?branch=main)\n[![R build status](https://github.com/r-lib/xml2/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/xml2/actions)\n[![R-CMD-check](https://github.com/r-lib/xml2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/xml2/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nThe xml2 package is a binding to [libxml2](http://xmlsoft.org), making it easy to work with HTML and XML from R. The API is somewhat inspired by [jQuery](https://jquery.com).\n\n## Installation\n\nYou can install xml2 from CRAN, \n\n```r\ninstall.packages(\"xml2\")\n```\n\nor you can install the development version from github, using `pak`:\n\n```r\n# install.packages(\"pak\")\npak::pak(\"r-lib/xml2\")\n```\n\n## Usage\n\n```r\nlibrary(xml2)\nx \u003c- read_xml(\"\u003cfoo\u003e \u003cbar\u003e text \u003cbaz/\u003e \u003c/bar\u003e \u003c/foo\u003e\")\nx\n\nxml_name(x)\nxml_children(x)\nxml_text(x)\nxml_find_all(x, \".//baz\")\n\nh \u003c- read_html(\"\u003chtml\u003e\u003cp\u003eHi \u003cb\u003e!\")\nh\nxml_name(h)\nxml_text(h)\n```\n\nThere are three key classes:\n\n* `xml_node`: a single node in a document.\n\n* `xml_doc`: the complete document. Acting on a document is usually the same \n  as acting on the root node of the document.\n\n* `xml_nodeset`: a __set__ of nodes within the document. Operations on \n  `xml_nodeset`s are vectorised, apply the operation over each node in the set.\n\n## Compared to the XML package\n\nxml2 has similar goals to the XML package. The main differences are:\n\n* xml2 takes care of memory management for you. It will automatically\n  free the memory used by an XML document as soon as the last reference\n  to it goes away.\n\n* xml2 has a very simple class hierarchy so you don't need to think about exactly \n  what type of object you have, xml2 will just do the right thing.\n\n* More convenient handling of namespaces in Xpath expressions - see `xml_ns()` \n  and `xml_ns_strip()` to get started.\n\n## Code of Conduct\n\nPlease note that the xml2 project is released with a [Contributor Code of Conduct](https://xml2.r-lib.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fxml2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fxml2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fxml2/lists"}