Skip to main content

XSD anyURI

anyURI data type is used to specify a URI.

AnyURI Data Type

The anyURI data type is used to specify a URI.

Let's see an example:

<xs:attribute name="src" type="xs:anyURI"/>

and an element in your XML document look like this:

<img src="www.example.com/images/myimage.png"  />
note

If a URI has spaces, replace them with %20.

Restrictions on AnyURI Data Type

Restrictions that can be used with anyURI data type:

  • enumeration
  • length
  • maxLength
  • minLength
  • pattern
  • whiteSpace

See XSD Restrictions chapter to learn more.