{"action":"created","issue":{"url":"https://api.github.com/repos/brunato/xmlschema/issues/79","repository_url":"https://api.github.com/repos/brunato/xmlschema","labels_url":"https://api.github.com/repos/brunato/xmlschema/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/brunato/xmlschema/issues/79/comments","events_url":"https://api.github.com/repos/brunato/xmlschema/issues/79/events","html_url":"https://github.com/brunato/xmlschema/issues/79","id":359376665,"node_id":"MDU6SXNzdWUzNTkzNzY2NjU=","number":79,"title":"Pattern restrictions for special characters in XPATH expressions not working as intended","user":{"login":"ikrEErki","id":43201627,"node_id":"MDQ6VXNlcjQzMjAxNjI3","avatar_url":"https://avatars0.githubusercontent.com/u/43201627?v=4","gravatar_id":"","url":"https://api.github.com/users/ikrEErki","html_url":"https://github.com/ikrEErki","followers_url":"https://api.github.com/users/ikrEErki/followers","following_url":"https://api.github.com/users/ikrEErki/following{/other_user}","gists_url":"https://api.github.com/users/ikrEErki/gists{/gist_id}","starred_url":"https://api.github.com/users/ikrEErki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikrEErki/subscriptions","organizations_url":"https://api.github.com/users/ikrEErki/orgs","repos_url":"https://api.github.com/users/ikrEErki/repos","events_url":"https://api.github.com/users/ikrEErki/events{/privacy}","received_events_url":"https://api.github.com/users/ikrEErki/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-12T08:49:35Z","updated_at":"2018-09-23T09:52:31Z","closed_at":"2018-09-23T09:52:31Z","author_association":"NONE","body":"If you have a pattern restriction for an attribute, if the pattern contains special characters like new line (\\n) or tab (\\t), this lib escapes the \"\\\\\", making the pattern wrong.\r\n\r\nLook at this schema:\r\n`<xs:schema>\r\n\t<xs:element name=\"root\">\r\n\t\t<xs:complexType>\r\n\t\t\t<xs:attribute name=\"test\">\r\n\t\t\t\t<xs:simpleType>\r\n\t\t\t\t\t<xs:restriction base=\"xs:string\">\r\n\t\t\t\t\t\t<xs:pattern value=\"[^\\n\\t]+\"/>\r\n\t\t\t\t\t</xs:restriction>\r\n\t\t\t\t</xs:simpleType>\r\n\t\t\t</xs:attribute>\r\n\t\t</xs:complexType>\r\n\t</xs:element>\r\n</xs:schema>`\r\n\r\nThe following XML should be valid according to the schema but is not:\r\n`<root test=\"abcnt\"></root>`\r\n\r\nThis must be because the xmlschema library converts the xpath \"[^\\n\\t]+\" to \"[^\\\\\\n\\\\\\t]+\". The result is a pattern that does not allow \"\\\\\", \"n\" or \"t\" instead of not allowing \"\\n\" and \"\\t\" (new line and tab).\r\n\r\nIs this something that could be fixed? \r\n\r\nBest regards,\r\nikrEErki"},"comment":{"url":"https://api.github.com/repos/brunato/xmlschema/issues/comments/423804623","html_url":"https://github.com/brunato/xmlschema/issues/79#issuecomment-423804623","issue_url":"https://api.github.com/repos/brunato/xmlschema/issues/79","id":423804623,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzgwNDYyMw==","user":{"login":"brunato","id":2034665,"node_id":"MDQ6VXNlcjIwMzQ2NjU=","avatar_url":"https://avatars2.githubusercontent.com/u/2034665?v=4","gravatar_id":"","url":"https://api.github.com/users/brunato","html_url":"https://github.com/brunato","followers_url":"https://api.github.com/users/brunato/followers","following_url":"https://api.github.com/users/brunato/following{/other_user}","gists_url":"https://api.github.com/users/brunato/gists{/gist_id}","starred_url":"https://api.github.com/users/brunato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunato/subscriptions","organizations_url":"https://api.github.com/users/brunato/orgs","repos_url":"https://api.github.com/users/brunato/repos","events_url":"https://api.github.com/users/brunato/events{/privacy}","received_events_url":"https://api.github.com/users/brunato/received_events","type":"User","site_admin":false},"created_at":"2018-09-23T09:52:31Z","updated_at":"2018-09-23T09:52:31Z","author_association":"OWNER","body":"Issue fixed into new release 1.0.4."}}
{"actor":{"display_login":"brunato"}}