{"id":19905126,"url":"https://github.com/solutena/excel-xml","last_synced_at":"2026-05-11T01:26:21.781Z","repository":{"id":239509653,"uuid":"799715864","full_name":"solutena/Excel-XML","owner":"solutena","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-13T00:47:23.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T21:41:00.360Z","etag":null,"topics":["conflict","excel","git","macro","merge","unity","vba","xls","xlsm","xlsx","xml"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solutena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-13T00:14:16.000Z","updated_at":"2024-05-13T11:11:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"a62bfff9-e4ce-469e-8d39-42559bcf2e1f","html_url":"https://github.com/solutena/Excel-XML","commit_stats":null,"previous_names":["solutena/excel-xml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutena%2FExcel-XML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutena%2FExcel-XML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutena%2FExcel-XML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutena%2FExcel-XML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solutena","download_url":"https://codeload.github.com/solutena/Excel-XML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241335516,"owners_count":19946068,"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":["conflict","excel","git","macro","merge","unity","vba","xls","xlsm","xlsx","xml"],"created_at":"2024-11-12T20:31:32.616Z","updated_at":"2026-05-11T01:26:21.715Z","avatar_url":"https://github.com/solutena.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Excel-XML\n\n엑셀에서 XML을 편리하게 사용할 수 있는 기능을 제공합니다.\n\nGit에서 엑셀이 충돌하여 병합하고 싶을 때 간단히 해결할 수 있습니다.\n\n# VBA\n```\nSub Export()\n    On Error GoTo ErrorHandler\n    \n    Dim XmlMap As XmlMap\n    Dim FileName As String\n    Dim FilePath As String\n\n    Set XmlMap = ActiveWorkbook.XmlMaps(\"Array\")\n    FileName = Split(ThisWorkbook.Name, \".\")(0)\n    FilePath = ThisWorkbook.Path \u0026 \"\\\" \u0026 FileName \u0026 \".xml\"\n\n    ActiveWorkbook.SaveAsXMLData FilePath, XmlMap\n    ActiveWorkbook.Save\n\n    MsgBox FilePath \u0026 vbCrLf \u0026 \"XML 데이터를 성공적으로 내보냈습니다.\", vbInformation\n    Exit Sub\n\nErrorHandler:\n    MsgBox \"XML 데이터를 저장하는 도중 오류가 발생했습니다.\", vbCritical\nEnd Sub\n\nSub ImportSchema()\n    Dim FileName As String\n    Dim FilePath As String\n\n    FileName = Split(ThisWorkbook.Name, \".\")(0) \u0026 \"_Schema\"\n    FilePath = ThisWorkbook.Path \u0026 \"\\\" \u0026 FileName \u0026 \".xml\"\n\n    If Dir(FilePath) \u003c\u003e \"\" Then\n        If MsgBox(FilePath \u0026 vbCrLf \u0026 vbCrLf \u0026 \"스키마를 다시 불러오시겠습니까?\", vbYesNo) = vbYes Then\n            For i = ActiveWorkbook.XmlMaps.Count To 1 Step -1\n                ActiveWorkbook.XmlMaps(i).Delete\n            Next\n            ActiveWorkbook.XmlMaps.Add(FilePath).Name = \"Array\"\n        End If\n    Else\n        MsgBox FilePath \u0026 vbCrLf \u0026 vbCrLf \u0026 \"스키마 파일이 존재하지 않습니다.\", vbExclamation\n    End If\nEnd Sub\n\nSub ImportXML()\n    Dim XmlMap As XmlMap\n    Dim FileName As String\n    Dim FilePath As String\n    \n    FileName = Split(ThisWorkbook.Name, \".\")(0)\n    FilePath = ThisWorkbook.Path \u0026 \"\\\" \u0026 FileName \u0026 \".xml\"\n    \n    If MsgBox(FilePath \u0026 vbCrLf \u0026 vbCrLf \u0026 \"XML을 불러와 데이터에 덮어쓰시겠습니까?\", vbYesNo) = vbYes Then\n        Set XmlMap = ActiveWorkbook.XmlMaps(\"Array\")\n        XmlMap.Import Url:=FilePath\n    End If\nEnd Sub\n```\n\n## 함수 설명\n\n`Export`\n\n\"엑셀파일이름\" 이름으로 된 XML을 내보낸 후\n\n엑셀을 저장 합니다.\n\n`ImportSchema`\n\n\"엑셀파일이름_Schema\" 이름으로 된 스키마를 읽어옵니다.\n\n개발도구 \u003e 원본 에서 새롭게 매핑을 해주시면 됩니다. \n\n\n`ImportXML`\n\n\"엑셀파일이름\" 이름으로 된 XML을 읽어와 데이터에 덮어씁니다.\n\ngit에서 엑셀이 컴플릿이 났을 때\n\n올바르게 병합된 XML으로부터 데이터를 덮어 쓸 수 있습니다.\n\n## 사용법\n\n![image](https://github.com/solutena/Excel-XML/assets/22467083/b0024164-6254-44df-b432-64c07d258ef0)\n\nVisual Basic에 들어가 모듈에 VBA 함수를 추가 합니다.\n\n![image](https://github.com/solutena/Excel-XML/assets/22467083/747d20f6-2ef6-4577-a5f7-296f9ac51c35)\n\n데이터를 작성 후 버튼을 만들어\n\n각 버튼의 매크로 지정에 함수를 적용하면 됩니다.\n\nXML로 추출할 데이터의 예제입니다.\n\n# Unity\n\n## XML 예제\n```\nusing System.Xml.Serialization;\n \npublic class Message\n{\n    [XmlAttribute] public string key = string.Empty;\n    [XmlAttribute] public string text = string.Empty;\n}\n```\n\nXML로 추출할 데이터의 예제입니다.\n\n## Unity-XML\n```\nconst string xmlExtension = \".xml\";\npublic static readonly string streamingPath = Application.streamingAssetsPath + \"/\";\n\npublic static void ExportXML\u003cT\u003e() where T : new()\n{\n\tT[] target = { new T(), new T() };\n\tstring key = typeof(T).FullName + \"_Schema\";\n\tstring path = streamingPath + key + xmlExtension;\n\tvar serializer = new XmlSerializer(typeof(T[]));\n\tusing XmlTextWriter writer = new(path, Encoding.UTF8);\n\twriter.Formatting = Formatting.Indented;\n\tserializer.Serialize(writer, target);\n\tDebug.Log(\"내보내기(\" + key + \") : \" + path);\n}\n\npublic static T[] ImportXML\u003cT\u003e()\n{\n\tstring key = typeof(T).FullName;\n\tstring path = streamingPath + key + xmlExtension;\n\tDebug.Log(\"불러오기(\" + key + \") : \" + path);\n\tvar serializer = new XmlSerializer(typeof(T[]));\n\tusing StringReader stringReader = new(File.ReadAllText(path));\n\treturn (T[])serializer.Deserialize(stringReader);\n}\n```\n\n`ExportXML`\n\n\"클래스명_Schema\" 이름으로 된 XML스키마를 내보냅니다.\n\n스키마는 2개의 데이터로된 배열로 만들어 내보냅니다.\n\n배열로 만들어야 엑셀에서 표의 형태로 생성됩니다.\n\n`ImportXML`\n\n\"클래스명\" 이름으로 된 XML을 데이터 배열로 불러옵니다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolutena%2Fexcel-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolutena%2Fexcel-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolutena%2Fexcel-xml/lists"}