SecondCity Posted April 12, 2017 Share Posted April 12, 2017 Below is an XML snippet for a payment gateway... <?xml version="1.0" encoding="utf-8"?> <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> I assume "xmlns" means "XML namespace", but how does this work? The file path above seems incomplete, and in the sample code I am looking at, I don't see any other references to a .xsd file or to information that would make the above xml path work. Quote Link to comment Share on other sites More sharing options...
NigelRel3 Posted April 12, 2017 Share Posted April 12, 2017 Yup - xmlns is for XML namespaces, this one is the default namespace as it doesn't specify a prefix. A quick Google finds...https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd which is probably what it should point at. The URI you have is a relative one which can be prone to getting out of date. Quote Link to comment Share on other sites More sharing options...
SecondCity Posted April 12, 2017 Author Share Posted April 12, 2017 Yup - xmlns is for XML namespaces, this one is the default namespace as it doesn't specify a prefix. A quick Google finds...https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd which is probably what it should point at. The URI you have is a relative one which can be prone to getting out of date. So does the code I posted note work? Is it supposed to be like that or should it be a properly formed URL like you mentioned? Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted April 12, 2017 Share Posted April 12, 2017 Namespaces are just arbitrary IDs. They don't have to be valid URLs; in fact, they aren't treated like URLs at all, and relative URLs like in your example above are explicitly deprecated (which doesn't change the fact that people still use them). Quote Link to comment Share on other sites More sharing options...
SecondCity Posted April 12, 2017 Author Share Posted April 12, 2017 Namespaces are just arbitrary IDs. They don't have to be valid URLs; in fact, they aren't treated like URLs at all, and relative URLs like in your example above are explicitly deprecated (which doesn't change the fact that people still use them). Okay, good to know. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.