1

I have an XSD with the following heading:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns="http://suri.hacienda.pr.gov.IITPRM2019.schema"
           targetNamespace="http://suri.hacienda.pr.gov.IITPRM2019.schema">

I am doing the programming to create a file with the information in XML.

This is the heading I wrote on the XML:

<?xml version="1.0"?>
<ns:PR482_2019 xmlns:ns="http://suri.hacienda.pr.gov.IITPRM2019.schema"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://suri.hacienda.pr.gov.IITPRM2019.schema">

But when I check if the XML is well formed, this is what I got:

ETieInd2019.xml:2,194: FATAL ERROR: The schemaLocation attribute does not contain pairs of values.

How can I eliminate this error?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
aimcorp
  • 9
  • 2

1 Answers1

1

As the error tells you, xsi:schemaLocation values must be pairs, separated by whitespace.

xsi:schemaLocation="NAMESPACE_URI LOCATION"
                                 ^^^^^^^^^ missing in your declaration

To solve the problem, add LOCATION as a system identifier specifying the physical location of the XSD.

(Note that there can be multiple pairs if you have multiple namespaces for which to specify associated XSDs.)

See also

kjhughes
  • 106,133
  • 27
  • 181
  • 240