1

What is wrong with my XML?

I am trying to import a metric family into PM, and it gives me the following error:

cvc-elt.1: Cannot find the declaration of element 'DataModel'

<?xml version="1.0" encoding="UTF-8"?>
<!--Auto-generated by the type catalog local manager.-->
<DataModel xmlns="http://im.ca.com/normalizer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://im.ca.com/normalizer IMDBCertificationFacet.xsd">
  <Author>JMEDRAN</Author>
  <Version>1.0</Version>
  <FacetType name="NormalizedUPSInfoEltek" descriptorClass="com.ca.im.core.datamodel.certs.NormalizedFacetDescriptorImpl">
    <Documentation>Defines the identification information and polled metrics for UPS-Eltek-S</Documentation>
    <FacetOf namespace="http://im.ca.com/core" name="Item" />
</DataModel>
kjhughes
  • 106,133
  • 27
  • 181
  • 240
J MR
  • 5
  • 3

1 Answers1

0

To place DataModel into the http://im.ca.com/normalizer namespace, rather than

namespace="http://im.ca.com/normalizer" 

use

xmlns="http://im.ca.com/normalizer" 

and change

xsi:noNamespaceSchemaLocation="IMDBCertificationFacet.xsd"

to

xsi:schemaLocation="http://im.ca.com/normalizer IMDBCertificationFacet.xsd"

Still having problems?

See these two references for how to specify the location of your XSD:

See this reference to understand how XML and XSD namespace-related attributes work together:


Update after OP added full XML to question

It appears that your XML has a namespace model that's being managed by the XML application, thus the namespace="http://im.ca.com/normalizer" attributes. Given that, the above advice to use xmlns instead may be misguided.

Your question may actually be more about the particular XML application that uses the XML than it is about XML validation against an XSD. If you feel that you simply wish to validate the XML against an XSD, please post a MCVE that includes a minimal XML instance and a minimal XSD to receive specific further guidance, or see the general XML validation reference links provided above.

kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • The problem persist friend. The new code is: – J MR Jan 22 '20 at 14:58
  • Please add updated XML and XSD to your question, not to the comments. If you can create a *complete* and *minimal* [mcve], I can find your specific problem. Otherwise, see the provided links for general advice. – kjhughes Jan 22 '20 at 15:16