{"action":"created","comment":{"url":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/comments/70571465","id":70571465,"diff_hunk":"@@ -0,0 +1,93 @@\n+# XML Parser Transform\n+\n+Description\n+-----------\n+The XML Parser Transform uses XPath to extract fields from a complex XML event. This plugin should generally be used\n+in conjunction with the XML Reader Batch Source. The XML Reader will provide individual events to the XML Parser,\n+which will be responsible for extracting fields from the events and mapping them to the output schema.\n+\n+\n+Use Case\n+--------\n+The transform takes an input record that contain XML events or records, parses it using the specified XPaths and returns\n+a structured record according to the specified schema. For example, this plugin can be used in conjunction with the XML\n+Reader Batch Source to extract values from XMLNews documents and create structured records which are easier to query.\n+\n+\n+Properties\n+----------\n+\n+**input:** The field in the input record that is the source of the XML event or record.\n+\n+**encoding:** The source XML character set encoding (default UTF-8).\n+\n+**xPathMappings:** Mapping of the field names to the XPaths of the XML record. A comma-separated list, each element of\n+which is a field name, followed by a colon, followed by an XPath expression. XPath location paths can include predicates\n+and supports XPath 1.0.\n+Example : ``<field-name>:<XPath expression>``\n+\n+**fieldTypeMapping:** Mapping of field names in the output schema to data types. Consists of a comma-separated list,\n+each element of which is a field name followed by a colon and a type, where the field names are the same as used in the\n+xPathMappings, and the type is one of: boolean, int, long, float, double, bytes, or string.\n+Example : ``<field-name>:<data-type>``\n+\n+**processOnError:** The action to take in case of an error.\n+                     - \"Ignore error and continue\"\n+                     - \"Exit on error\" : Stops processing upon encountering an error\n+                     - \"Write to error dataset\" :  Writes the error record to an error dataset and continues\n+\n+Example\n+-------\n+\n+This example parses an XML record received in the \"body\" field of the input record following the *xPathMappings* for\n+each field name. The output structured record will be created  using the type specified for each field in the\n+\"fieldTypeMapping\". Only years and prices will be passed on for books with a price over 35.00:\n+\n+       {\n+            \"name\": \"XMLParser\",\n+            \"plugin\": {\n+                \"name\": \"XMLParser\",\n+                \"type\": \"transform\",\n+                \"label\": \"XMLParser\",\n+                \"properties\": {\n+                    \"input\": \"body\",\n+                    \"encoding\": \"UTF-8\",\n+                    \"xPathMappings\": \"category://book/@category,\n+                                      title://book/title,\n+                                      year:/bookstore/book[price>35.00]/year,\n+                                      price:/bookstore/book[price>35.00]/price,\n+                                      subcategory://book/subcategory\",\n+                    \"fieldTypeMapping\": \"category:string,title:string,year:int,price:double,subcategory:string\",\n+                    \"processOnError\": \"Ignore error and continue\"\n+                }\n+            }\n+       }\n+\n+For example, suppose the transform receives these input records:\n+\n+    +=========================================================================================================+\n+    | offset   | body                                                                                         |\n+    +=========================================================================================================+\n+    | 1        | <bookstore><book category=\"cooking\"><subcategory><type>Continental</type><genre>European     |\n+    |          | cuisines</genre></subcategory><title lang=\"en\">Everyday Italian</title><author>Giada De      |\n+    |          | Laurentiis</author><year>2005</year><price>30.00</price></book></bookstore>                  |\n+    | 2        | <bookstore><book category=\"children\"><subcategory><type>Series</type><genre>fantasy          |\n+    |          | literature</genre></subcategory><title lang=\"en\">Harry Potter</title><author>J. K. Rowling   |\n+    |          | </author><year>2005</year><price>49.99</price></book></bookstore>                            |\n+    +=========================================================================================================+\n+\n+The output records will contain:\n+\n+    +=========================================================================================================+\n+    | category  | title              | year   |  price  | subcategory                                         |\n+    +=========================================================================================================+\n+    | cooking   | Everyday Italian   | null   |  null   | <subcategory><type>Continental</type><genre>European|\n+    |           |                    |        |         | cuisines</genre></subcategory>                      |\n+    | children  | Harry Potter       | 2005   | 49.99   | <subcategory><type>Series</type><genre>fantasy      |\n+    |           |                    |        |         | literature</genre></subcategory>                    |\n+    +=========================================================================================================+\n+\n+Here, since the subcategory contains child nodes, the plugin will retrun the complete subcategory node (along with its\n+child elements) as string as ``<subcategory><type>Continental</type><genre>European cuisines</genre></subcategory>`` .\n+This is to ensure that the plugin returns a sigle XML event for a structured record intead of the two child events:","path":"transform-plugins/docs/XMLParser-transform.md","position":92,"original_position":92,"commit_id":"7bad749cac8628186737a97ecf4c042dcbdc013a","original_commit_id":"7bad749cac8628186737a97ecf4c042dcbdc013a","user":{"login":"anwar6953","id":2440977,"avatar_url":"https://avatars.githubusercontent.com/u/2440977?v=3","gravatar_id":"","url":"https://api.github.com/users/anwar6953","html_url":"https://github.com/anwar6953","followers_url":"https://api.github.com/users/anwar6953/followers","following_url":"https://api.github.com/users/anwar6953/following{/other_user}","gists_url":"https://api.github.com/users/anwar6953/gists{/gist_id}","starred_url":"https://api.github.com/users/anwar6953/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anwar6953/subscriptions","organizations_url":"https://api.github.com/users/anwar6953/orgs","repos_url":"https://api.github.com/users/anwar6953/repos","events_url":"https://api.github.com/users/anwar6953/events{/privacy}","received_events_url":"https://api.github.com/users/anwar6953/received_events","type":"User","site_admin":false},"body":"\"sigle\" --> \"single\"?","created_at":"2016-07-13T06:42:58Z","updated_at":"2016-07-13T06:42:58Z","html_url":"https://github.com/caskdata/hydrator-plugins/pull/309#discussion_r70571465","pull_request_url":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309","_links":{"self":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/comments/70571465"},"html":{"href":"https://github.com/caskdata/hydrator-plugins/pull/309#discussion_r70571465"},"pull_request":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309"}}},"pull_request":{"url":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309","id":77148131,"html_url":"https://github.com/caskdata/hydrator-plugins/pull/309","diff_url":"https://github.com/caskdata/hydrator-plugins/pull/309.diff","patch_url":"https://github.com/caskdata/hydrator-plugins/pull/309.patch","issue_url":"https://api.github.com/repos/caskdata/hydrator-plugins/issues/309","number":309,"state":"open","locked":false,"title":"[CDAP-6177] XMLParser transform plugin","user":{"login":"ananya-bhattacharya","id":10112217,"avatar_url":"https://avatars.githubusercontent.com/u/10112217?v=3","gravatar_id":"","url":"https://api.github.com/users/ananya-bhattacharya","html_url":"https://github.com/ananya-bhattacharya","followers_url":"https://api.github.com/users/ananya-bhattacharya/followers","following_url":"https://api.github.com/users/ananya-bhattacharya/following{/other_user}","gists_url":"https://api.github.com/users/ananya-bhattacharya/gists{/gist_id}","starred_url":"https://api.github.com/users/ananya-bhattacharya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ananya-bhattacharya/subscriptions","organizations_url":"https://api.github.com/users/ananya-bhattacharya/orgs","repos_url":"https://api.github.com/users/ananya-bhattacharya/repos","events_url":"https://api.github.com/users/ananya-bhattacharya/events{/privacy}","received_events_url":"https://api.github.com/users/ananya-bhattacharya/received_events","type":"User","site_admin":false},"body":"The XMLParser transform plugin receives structured record from XMLReader source plugin and creates structured record based on the xpath specified by the user for each field.\r\nWiki link for Requirements and Design : https://wiki.cask.co/display/CE/XML+Parser\r\n\r\nAll review comments from https://github.com/caskdata/hydrator-plugins/pull/293 are addressed in this PR.","created_at":"2016-07-12T16:29:42Z","updated_at":"2016-07-13T06:42:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"928316b46fab6d9902b09f01a9ccf39cc009ebf9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309/commits","review_comments_url":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309/comments","review_comment_url":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/caskdata/hydrator-plugins/issues/309/comments","statuses_url":"https://api.github.com/repos/caskdata/hydrator-plugins/statuses/7bad749cac8628186737a97ecf4c042dcbdc013a","head":{"label":"ananya-bhattacharya:xml-parser-transform","ref":"xml-parser-transform","sha":"7bad749cac8628186737a97ecf4c042dcbdc013a","user":{"login":"ananya-bhattacharya","id":10112217,"avatar_url":"https://avatars.githubusercontent.com/u/10112217?v=3","gravatar_id":"","url":"https://api.github.com/users/ananya-bhattacharya","html_url":"https://github.com/ananya-bhattacharya","followers_url":"https://api.github.com/users/ananya-bhattacharya/followers","following_url":"https://api.github.com/users/ananya-bhattacharya/following{/other_user}","gists_url":"https://api.github.com/users/ananya-bhattacharya/gists{/gist_id}","starred_url":"https://api.github.com/users/ananya-bhattacharya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ananya-bhattacharya/subscriptions","organizations_url":"https://api.github.com/users/ananya-bhattacharya/orgs","repos_url":"https://api.github.com/users/ananya-bhattacharya/repos","events_url":"https://api.github.com/users/ananya-bhattacharya/events{/privacy}","received_events_url":"https://api.github.com/users/ananya-bhattacharya/received_events","type":"User","site_admin":false},"repo":{"id":58439270,"name":"hydrator-plugins","full_name":"ananya-bhattacharya/hydrator-plugins","owner":{"login":"ananya-bhattacharya","id":10112217,"avatar_url":"https://avatars.githubusercontent.com/u/10112217?v=3","gravatar_id":"","url":"https://api.github.com/users/ananya-bhattacharya","html_url":"https://github.com/ananya-bhattacharya","followers_url":"https://api.github.com/users/ananya-bhattacharya/followers","following_url":"https://api.github.com/users/ananya-bhattacharya/following{/other_user}","gists_url":"https://api.github.com/users/ananya-bhattacharya/gists{/gist_id}","starred_url":"https://api.github.com/users/ananya-bhattacharya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ananya-bhattacharya/subscriptions","organizations_url":"https://api.github.com/users/ananya-bhattacharya/orgs","repos_url":"https://api.github.com/users/ananya-bhattacharya/repos","events_url":"https://api.github.com/users/ananya-bhattacharya/events{/privacy}","received_events_url":"https://api.github.com/users/ananya-bhattacharya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ananya-bhattacharya/hydrator-plugins","description":"Cask Hydrator Plugins Repository","fork":true,"url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins","forks_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/forks","keys_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/teams","hooks_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/hooks","issue_events_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/events","assignees_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/tags","blobs_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/languages","stargazers_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/stargazers","contributors_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/contributors","subscribers_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/subscribers","subscription_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/subscription","commits_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/merges","archive_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/downloads","issues_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/labels{/name}","releases_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/ananya-bhattacharya/hydrator-plugins/deployments","created_at":"2016-05-10T07:28:29Z","updated_at":"2016-05-10T07:28:31Z","pushed_at":"2016-07-12T12:16:09Z","git_url":"git://github.com/ananya-bhattacharya/hydrator-plugins.git","ssh_url":"git@github.com:ananya-bhattacharya/hydrator-plugins.git","clone_url":"https://github.com/ananya-bhattacharya/hydrator-plugins.git","svn_url":"https://github.com/ananya-bhattacharya/hydrator-plugins","homepage":"","size":2826,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"caskdata:develop","ref":"develop","sha":"cd7dce446671015aa1e0115cc4a7a04a35d969bb","user":{"login":"caskdata","id":8123023,"avatar_url":"https://avatars.githubusercontent.com/u/8123023?v=3","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"repo":{"id":39922362,"name":"hydrator-plugins","full_name":"caskdata/hydrator-plugins","owner":{"login":"caskdata","id":8123023,"avatar_url":"https://avatars.githubusercontent.com/u/8123023?v=3","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caskdata/hydrator-plugins","description":"Cask Hydrator Plugins Repository","fork":false,"url":"https://api.github.com/repos/caskdata/hydrator-plugins","forks_url":"https://api.github.com/repos/caskdata/hydrator-plugins/forks","keys_url":"https://api.github.com/repos/caskdata/hydrator-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caskdata/hydrator-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caskdata/hydrator-plugins/teams","hooks_url":"https://api.github.com/repos/caskdata/hydrator-plugins/hooks","issue_events_url":"https://api.github.com/repos/caskdata/hydrator-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/caskdata/hydrator-plugins/events","assignees_url":"https://api.github.com/repos/caskdata/hydrator-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/caskdata/hydrator-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/caskdata/hydrator-plugins/tags","blobs_url":"https://api.github.com/repos/caskdata/hydrator-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caskdata/hydrator-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caskdata/hydrator-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/caskdata/hydrator-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caskdata/hydrator-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/caskdata/hydrator-plugins/languages","stargazers_url":"https://api.github.com/repos/caskdata/hydrator-plugins/stargazers","contributors_url":"https://api.github.com/repos/caskdata/hydrator-plugins/contributors","subscribers_url":"https://api.github.com/repos/caskdata/hydrator-plugins/subscribers","subscription_url":"https://api.github.com/repos/caskdata/hydrator-plugins/subscription","commits_url":"https://api.github.com/repos/caskdata/hydrator-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/caskdata/hydrator-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/caskdata/hydrator-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/caskdata/hydrator-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/caskdata/hydrator-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/caskdata/hydrator-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caskdata/hydrator-plugins/merges","archive_url":"https://api.github.com/repos/caskdata/hydrator-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caskdata/hydrator-plugins/downloads","issues_url":"https://api.github.com/repos/caskdata/hydrator-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/caskdata/hydrator-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/caskdata/hydrator-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caskdata/hydrator-plugins/labels{/name}","releases_url":"https://api.github.com/repos/caskdata/hydrator-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/caskdata/hydrator-plugins/deployments","created_at":"2015-07-30T00:14:48Z","updated_at":"2016-07-04T15:58:46Z","pushed_at":"2016-07-13T04:47:10Z","git_url":"git://github.com/caskdata/hydrator-plugins.git","ssh_url":"git@github.com:caskdata/hydrator-plugins.git","clone_url":"https://github.com/caskdata/hydrator-plugins.git","svn_url":"https://github.com/caskdata/hydrator-plugins","homepage":"","size":3172,"stargazers_count":18,"watchers_count":18,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":7,"forks":13,"open_issues":7,"watchers":18,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309"},"html":{"href":"https://github.com/caskdata/hydrator-plugins/pull/309"},"issue":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/issues/309"},"comments":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/issues/309/comments"},"review_comments":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309/comments"},"review_comment":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/pulls/309/commits"},"statuses":{"href":"https://api.github.com/repos/caskdata/hydrator-plugins/statuses/7bad749cac8628186737a97ecf4c042dcbdc013a"}}}}
{"actor":{"display_login":"anwar6953"}}