Reputation: 1111
I am relatively new to work related to XML Schema and have been trying to figure out which XML Schema datatype I should use for a file path. Is it string or anyURI which is most accurate in this case?
Upvotes: 7
Views: 4369
Reputation: 111630
I'd recommend xsd:anyURI
[Definition:] anyURI represents a Uniform Resource Identifier Reference (URI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be a URI Reference). This type should be used to specify the intention that the value fulfills the role of a URI as defined by [RFC 2396], as amended by [RFC 2732].
with no scheme component for relative paths or a file
scheme component for absolute paths.
Examples:
../path/to/filename.txt
file:///c:/path/to/filename.txt
Upvotes: 9