{"action":"created","comment":{"url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/comments/61683608","id":61683608,"diff_hunk":"@@ -55,36 +67,73 @@ void runImport() throws XMLStreamException\n \n             if (currentEvent.isStartElement())\n             {\n+                if (skipFile(currentEvent.asStartElement()))\n+                {\n+                    return;\n+                }\n                 foundStartElement(currentEvent.asStartElement());\n             }\n         }\n     }\n \n+    private boolean skipFile(final StartElement startElement)\n+    {\n+        if (this.validRootElementFound)\n+        {\n+            return false;\n+        }\n+        if (rootElementWhitelisted(startElement))\n+        {\n+            this.validRootElementFound = true;\n+            return false;\n+        }\n+        LOG.warning(() -> \"Found unknown XML root element '\" + startElement.getName()\n+                + \"': skip file.\");\n+        return true;\n+    }\n+\n+    private boolean rootElementWhitelisted(final StartElement rootElement)\n+    {\n+        final String elementName = rootElement.getName().getLocalPart();\n+        return SPECDOCUMENT_ROOT_ELEMENT_NAME.equals(elementName);\n+    }\n+\n     private void foundStartElement(final StartElement element) throws XMLStreamException\n     {\n         switch (element.getName().getLocalPart())","path":"src/main/java/openfasttrack/importer/specobject/ImportHelper.java","position":62,"original_position":62,"commit_id":"a2ad5762a87c0d7c297c9136891f2e3d34dfb839","original_commit_id":"a2ad5762a87c0d7c297c9136891f2e3d34dfb839","user":{"login":"kaklakariada","id":4711730,"avatar_url":"https://avatars.githubusercontent.com/u/4711730?v=3","gravatar_id":"","url":"https://api.github.com/users/kaklakariada","html_url":"https://github.com/kaklakariada","followers_url":"https://api.github.com/users/kaklakariada/followers","following_url":"https://api.github.com/users/kaklakariada/following{/other_user}","gists_url":"https://api.github.com/users/kaklakariada/gists{/gist_id}","starred_url":"https://api.github.com/users/kaklakariada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaklakariada/subscriptions","organizations_url":"https://api.github.com/users/kaklakariada/orgs","repos_url":"https://api.github.com/users/kaklakariada/repos","events_url":"https://api.github.com/users/kaklakariada/events{/privacy}","received_events_url":"https://api.github.com/users/kaklakariada/received_events","type":"User","site_admin":false},"body":"We need the StartElement later in `foundStartElement()` to get attributes from it. I would prefer not to add an parameter for the element name with duplicate information.","created_at":"2016-05-01T08:27:19Z","updated_at":"2016-05-01T08:27:19Z","html_url":"https://github.com/hamstercommunity/openfasttrack/pull/35#discussion_r61683608","pull_request_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/comments/61683608"},"html":{"href":"https://github.com/hamstercommunity/openfasttrack/pull/35#discussion_r61683608"},"pull_request":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35","id":68473795,"html_url":"https://github.com/hamstercommunity/openfasttrack/pull/35","diff_url":"https://github.com/hamstercommunity/openfasttrack/pull/35.diff","patch_url":"https://github.com/hamstercommunity/openfasttrack/pull/35.patch","issue_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/35","number":35,"state":"open","locked":false,"title":"#34 Whitelist XML root elements","user":{"login":"kaklakariada","id":4711730,"avatar_url":"https://avatars.githubusercontent.com/u/4711730?v=3","gravatar_id":"","url":"https://api.github.com/users/kaklakariada","html_url":"https://github.com/kaklakariada","followers_url":"https://api.github.com/users/kaklakariada/followers","following_url":"https://api.github.com/users/kaklakariada/following{/other_user}","gists_url":"https://api.github.com/users/kaklakariada/gists{/gist_id}","starred_url":"https://api.github.com/users/kaklakariada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaklakariada/subscriptions","organizations_url":"https://api.github.com/users/kaklakariada/orgs","repos_url":"https://api.github.com/users/kaklakariada/repos","events_url":"https://api.github.com/users/kaklakariada/events{/privacy}","received_events_url":"https://api.github.com/users/kaklakariada/received_events","type":"User","site_admin":false},"body":"Skip files with unknown root element. See #34 ","created_at":"2016-04-30T17:29:20Z","updated_at":"2016-05-01T08:27:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76450ea66670982b8de4c19667d519b85e531b64","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35/commits","review_comments_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35/comments","review_comment_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/35/comments","statuses_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/statuses/a2ad5762a87c0d7c297c9136891f2e3d34dfb839","head":{"label":"hamstercommunity:#34_Whitelist_XML_root_elements","ref":"#34_Whitelist_XML_root_elements","sha":"a2ad5762a87c0d7c297c9136891f2e3d34dfb839","user":{"login":"hamstercommunity","id":12786252,"avatar_url":"https://avatars.githubusercontent.com/u/12786252?v=3","gravatar_id":"","url":"https://api.github.com/users/hamstercommunity","html_url":"https://github.com/hamstercommunity","followers_url":"https://api.github.com/users/hamstercommunity/followers","following_url":"https://api.github.com/users/hamstercommunity/following{/other_user}","gists_url":"https://api.github.com/users/hamstercommunity/gists{/gist_id}","starred_url":"https://api.github.com/users/hamstercommunity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamstercommunity/subscriptions","organizations_url":"https://api.github.com/users/hamstercommunity/orgs","repos_url":"https://api.github.com/users/hamstercommunity/repos","events_url":"https://api.github.com/users/hamstercommunity/events{/privacy}","received_events_url":"https://api.github.com/users/hamstercommunity/received_events","type":"Organization","site_admin":false},"repo":{"id":48654534,"name":"openfasttrack","full_name":"hamstercommunity/openfasttrack","owner":{"login":"hamstercommunity","id":12786252,"avatar_url":"https://avatars.githubusercontent.com/u/12786252?v=3","gravatar_id":"","url":"https://api.github.com/users/hamstercommunity","html_url":"https://github.com/hamstercommunity","followers_url":"https://api.github.com/users/hamstercommunity/followers","following_url":"https://api.github.com/users/hamstercommunity/following{/other_user}","gists_url":"https://api.github.com/users/hamstercommunity/gists{/gist_id}","starred_url":"https://api.github.com/users/hamstercommunity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamstercommunity/subscriptions","organizations_url":"https://api.github.com/users/hamstercommunity/orgs","repos_url":"https://api.github.com/users/hamstercommunity/repos","events_url":"https://api.github.com/users/hamstercommunity/events{/privacy}","received_events_url":"https://api.github.com/users/hamstercommunity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hamstercommunity/openfasttrack","description":"Requirement tracking suite","fork":false,"url":"https://api.github.com/repos/hamstercommunity/openfasttrack","forks_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/forks","keys_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/teams","hooks_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/hooks","issue_events_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/events{/number}","events_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/events","assignees_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/assignees{/user}","branches_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/branches{/branch}","tags_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/tags","blobs_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/refs{/sha}","trees_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/statuses/{sha}","languages_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/languages","stargazers_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/stargazers","contributors_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/contributors","subscribers_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/subscribers","subscription_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/subscription","commits_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/commits{/sha}","git_commits_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/commits{/sha}","comments_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/comments{/number}","issue_comment_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/comments{/number}","contents_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/contents/{+path}","compare_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/merges","archive_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/downloads","issues_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues{/number}","pulls_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls{/number}","milestones_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/milestones{/number}","notifications_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/labels{/name}","releases_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/releases{/id}","deployments_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/deployments","created_at":"2015-12-27T17:50:25Z","updated_at":"2016-03-30T13:26:18Z","pushed_at":"2016-05-01T08:22:52Z","git_url":"git://github.com/hamstercommunity/openfasttrack.git","ssh_url":"git@github.com:hamstercommunity/openfasttrack.git","clone_url":"https://github.com/hamstercommunity/openfasttrack.git","svn_url":"https://github.com/hamstercommunity/openfasttrack","homepage":null,"size":338,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":3,"default_branch":"master"}},"base":{"label":"hamstercommunity:master","ref":"master","sha":"14967017ad6ad97a05d74e40c9b3814de9989920","user":{"login":"hamstercommunity","id":12786252,"avatar_url":"https://avatars.githubusercontent.com/u/12786252?v=3","gravatar_id":"","url":"https://api.github.com/users/hamstercommunity","html_url":"https://github.com/hamstercommunity","followers_url":"https://api.github.com/users/hamstercommunity/followers","following_url":"https://api.github.com/users/hamstercommunity/following{/other_user}","gists_url":"https://api.github.com/users/hamstercommunity/gists{/gist_id}","starred_url":"https://api.github.com/users/hamstercommunity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamstercommunity/subscriptions","organizations_url":"https://api.github.com/users/hamstercommunity/orgs","repos_url":"https://api.github.com/users/hamstercommunity/repos","events_url":"https://api.github.com/users/hamstercommunity/events{/privacy}","received_events_url":"https://api.github.com/users/hamstercommunity/received_events","type":"Organization","site_admin":false},"repo":{"id":48654534,"name":"openfasttrack","full_name":"hamstercommunity/openfasttrack","owner":{"login":"hamstercommunity","id":12786252,"avatar_url":"https://avatars.githubusercontent.com/u/12786252?v=3","gravatar_id":"","url":"https://api.github.com/users/hamstercommunity","html_url":"https://github.com/hamstercommunity","followers_url":"https://api.github.com/users/hamstercommunity/followers","following_url":"https://api.github.com/users/hamstercommunity/following{/other_user}","gists_url":"https://api.github.com/users/hamstercommunity/gists{/gist_id}","starred_url":"https://api.github.com/users/hamstercommunity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamstercommunity/subscriptions","organizations_url":"https://api.github.com/users/hamstercommunity/orgs","repos_url":"https://api.github.com/users/hamstercommunity/repos","events_url":"https://api.github.com/users/hamstercommunity/events{/privacy}","received_events_url":"https://api.github.com/users/hamstercommunity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hamstercommunity/openfasttrack","description":"Requirement tracking suite","fork":false,"url":"https://api.github.com/repos/hamstercommunity/openfasttrack","forks_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/forks","keys_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/teams","hooks_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/hooks","issue_events_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/events{/number}","events_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/events","assignees_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/assignees{/user}","branches_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/branches{/branch}","tags_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/tags","blobs_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/refs{/sha}","trees_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/statuses/{sha}","languages_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/languages","stargazers_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/stargazers","contributors_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/contributors","subscribers_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/subscribers","subscription_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/subscription","commits_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/commits{/sha}","git_commits_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/git/commits{/sha}","comments_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/comments{/number}","issue_comment_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/comments{/number}","contents_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/contents/{+path}","compare_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/merges","archive_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/downloads","issues_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues{/number}","pulls_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls{/number}","milestones_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/milestones{/number}","notifications_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/labels{/name}","releases_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/releases{/id}","deployments_url":"https://api.github.com/repos/hamstercommunity/openfasttrack/deployments","created_at":"2015-12-27T17:50:25Z","updated_at":"2016-03-30T13:26:18Z","pushed_at":"2016-05-01T08:22:52Z","git_url":"git://github.com/hamstercommunity/openfasttrack.git","ssh_url":"git@github.com:hamstercommunity/openfasttrack.git","clone_url":"https://github.com/hamstercommunity/openfasttrack.git","svn_url":"https://github.com/hamstercommunity/openfasttrack","homepage":null,"size":338,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35"},"html":{"href":"https://github.com/hamstercommunity/openfasttrack/pull/35"},"issue":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/35"},"comments":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/hamstercommunity/openfasttrack/statuses/a2ad5762a87c0d7c297c9136891f2e3d34dfb839"}}}}