{"action":"closed","issue":{"url":"https://api.github.com/repos/STIXProject/python-stix/issues/306","repository_url":"https://api.github.com/repos/STIXProject/python-stix","labels_url":"https://api.github.com/repos/STIXProject/python-stix/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/STIXProject/python-stix/issues/306/comments","events_url":"https://api.github.com/repos/STIXProject/python-stix/issues/306/events","html_url":"https://github.com/STIXProject/python-stix/issues/306","id":181081488,"number":306,"title":"Start_Time and End_Time fields of 'Indicator's Valid_Time_Position cause validation error","user":{"login":"howaryoo","id":344267,"avatar_url":"https://avatars.githubusercontent.com/u/344267?v=3","gravatar_id":"","url":"https://api.github.com/users/howaryoo","html_url":"https://github.com/howaryoo","followers_url":"https://api.github.com/users/howaryoo/followers","following_url":"https://api.github.com/users/howaryoo/following{/other_user}","gists_url":"https://api.github.com/users/howaryoo/gists{/gist_id}","starred_url":"https://api.github.com/users/howaryoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howaryoo/subscriptions","organizations_url":"https://api.github.com/users/howaryoo/orgs","repos_url":"https://api.github.com/users/howaryoo/repos","events_url":"https://api.github.com/users/howaryoo/events{/privacy}","received_events_url":"https://api.github.com/users/howaryoo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-05T07:21:08Z","updated_at":"2016-10-06T17:40:40Z","closed_at":"2016-10-06T17:40:40Z","body":"Hi,\r\n\r\nusing the code below to generate an Indicator in XML format:\r\n\r\n\r\n```\r\nfrom stix.core import STIXPackage\r\nfrom stix.indicator import Indicator, ValidTime\r\nfrom stix.utils import now\r\n\r\nstix_package = STIXPackage()\r\n\r\nindicator = Indicator(title=\"title\")\r\n\r\nvalid_time = ValidTime(start_time=now())\r\nindicator.add_valid_time_position(valid_time)\r\n\r\nstix_package.add_indicator(indicator)\r\n\r\nprint stix_package.to_xml()\r\n\r\n```\r\n\r\nI get an invalid XML dateTime:\r\n\r\n```\r\n<indicator:Start_Time precision=\"second\">2016-10-05 07:01:42.397913+00:00</indicator:Start_Time>\r\n```\r\ninstead of the expected \"2016-10-05**T**07:01:42.397913+00:00\"\r\n\r\n\r\n`stix-validator` fails with the error below: \r\n\r\n\r\n> $stix-validator.py ./sample_out.xml \r\n> [-] Performing xml schema validation on ./sample_out.xml\r\n> ================================================================================\r\n> [-] Results: ./sample_out.xml\r\n> [!] XML Schema: False\r\n>     [!] ./sample_out.xml:15:0:ERROR:SCHEMASV:SCHEMAV_CVC_DATATYPE_VALID_1_2_1: Element '{http://stix.mitre.org/Indicator-2}Start_Time': '2016-10-05 07:01:42.397913+00:00' is not a valid value of the atomic type 'xs:dateTime'.\r\n> \r\n> "}}
{"actor":{"display_login":"gtback"}}