4

An XML file can be defined and validated with an Document Type Description (DTD) or XML Schema (xsd) as follows:

<?xml version='1.0' encoding='UTF-8'?>
<annotation xmlns="http://www.xyz.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.xyz.com
    file:system.xsd" >

or

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE annotation SYSTEM "http://www.xyz.de/system.dtd">

Both ways define a URL where the DTD or XSD is found. Is there a way to give a relative or local path? So I can store them allong with the XML files instead of relying on a server?

iltzortz
  • 2,342
  • 2
  • 19
  • 35
eactor
  • 862
  • 3
  • 14
  • 34

1 Answers1

15

It's easy. Just put the relative location of the file like

<?xml version='1.0' encoding='UTF-8'?>
<annotation xmlns="http://www.xyz.com" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xyz.com ./system.xsd" >
Stanley De Boer
  • 4,921
  • 1
  • 23
  • 31