{"id":15440050,"url":"https://github.com/santhosh-tekuri/dom","last_synced_at":"2025-04-19T19:34:46.101Z","repository":{"id":57497389,"uuid":"92504439","full_name":"santhosh-tekuri/dom","owner":"santhosh-tekuri","description":"XML Document Object Model in Go","archived":false,"fork":false,"pushed_at":"2018-11-04T09:42:37.000Z","size":18,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T12:21:12.244Z","etag":null,"topics":["dom","go","golang","xml"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/santhosh-tekuri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-26T11:29:50.000Z","updated_at":"2020-03-20T13:07:17.000Z","dependencies_parsed_at":"2022-09-03T23:20:54.591Z","dependency_job_id":null,"html_url":"https://github.com/santhosh-tekuri/dom","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santhosh-tekuri%2Fdom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santhosh-tekuri%2Fdom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santhosh-tekuri%2Fdom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santhosh-tekuri%2Fdom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santhosh-tekuri","download_url":"https://codeload.github.com/santhosh-tekuri/dom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249780573,"owners_count":21324580,"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":["dom","go","golang","xml"],"created_at":"2024-10-01T19:10:39.994Z","updated_at":"2025-04-19T19:34:46.082Z","avatar_url":"https://github.com/santhosh-tekuri.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dom\n\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![GoDoc](https://godoc.org/github.com/santhosh-tekuri/dom?status.svg)](https://godoc.org/github.com/santhosh-tekuri/dom)\n[![Go Report Card](https://goreportcard.com/badge/github.com/santhosh-tekuri/dom)](https://goreportcard.com/report/github.com/santhosh-tekuri/dom)\n[![Build Status](https://travis-ci.org/santhosh-tekuri/dom.svg?branch=master)](https://travis-ci.org/santhosh-tekuri/dom)\n[![codecov.io](https://codecov.io/github/santhosh-tekuri/dom/coverage.svg?branch=master)](https://codecov.io/github/santhosh-tekuri/dom?branch=master)\n\nPackage dom provides document object model for xml.\n\nIt does not strictly follow DOM interfaces, but has everything needed for xml processing library.\n\n## Example\n\n```go\nstr := `\n\u003cdeveloper xmlns=\"www.jroller.com/santhosh/\"\u003e\n\u003cname\u003eSanthosh Kumar Tekuri\u003c/name\u003e\n\u003cemail\u003esanthosh.tekuri@gmail.com\u003c/email\u003e\n\u003c/developer\u003e\n`\n\ndoc, err := dom.Unmarshal(xml.NewDecoder(strings.NewReader(str)))\nif err != nil {\n    fmt.Println(err)\n    return\n}\n\nroot := doc.RootElement()\nfmt.Printf(\"rootElement: {%s}%s\\n\", root.URI, root.Local)\nbuf := new(bytes.Buffer)\nif err = dom.Marshal(doc, buf); err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Printf(\"xml:\\n%s\", buf.String())\n```\n\nOutput:\n```\nrootElement: {www.jroller.com/santhosh/}developer\nxml:\n\u003cdeveloper xmlns=\"www.jroller.com/santhosh/\"\u003e\n    \u003cname\u003eSanthosh Kumar Tekuri\u003c/name\u003e\n    \u003cemail\u003esanthosh.tekuri@gmail.com\u003c/email\u003e\n\u003c/developer\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanthosh-tekuri%2Fdom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanthosh-tekuri%2Fdom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanthosh-tekuri%2Fdom/lists"}