We help IT Professionals succeed at work.

Unable to Parse schema file

835 Views
Last Modified: 2019-03-25
I'm trying to validate my xml file using notepad++.
I'm fairly new to XML so I'm having issues trying to resolve the following error:

Unable to parse schema file.
Parsing error at line 50:
Element'{http://www.w3.org/2001/XMLSchema}element', attribute
'ref': The QName value
'{urn:us:gov:treasure:irs:ext:aca:air:ty18}Form1094CUpstreamDetail'
does not resolve to a(n) element declaration.

This is what I have for the first couple of lines of the xml:
<?xml version="1.0" encoding="UTF-8"?>
<p:Form109495CTransmittalUpstream xmlns:p="urn:us:gov:treasury:irs:msg:form1094-1095Ctransmitterupstreammessage" xmlns:p1="urn:us:gov:treasury:irs:ext:aca:air:ty18" xmlns:p2="urn:us:gov:treasury:irs:common" xmlns:p3="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:us:gov:treasury:irs:msg:form1094-1095Ctransmitterupstreammessage IRS-Form1094-1095CTransmitterUpstreamMessage.xsd ">

Any thoughts on how I can resolve this?
I've attached the Schema file.
IRS-Form1094-1095CTransmitterUpstrea.xsd
Comment
Watch Question

Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
First, do you have the full schema?
There is a whole bunch of schema file references

Your message is not related to the XML,
it is related to a schema error..
make first sure you have all the files at the correct location

and you might find out that notepad++ is just not enough to deal with this XML complexity

anyhow, first the full schema
ste5anSenior Developer
CERTIFIED EXPERT

Commented:
Schema parsing depends on the used tool chain. As Geert already wrote, the tools often require that these are local to the tool.

An I agree on using Notepad++ for XML. Altova has imho the best commercial tools for Windows. A good free tool is Visual Studio Code. It has already some native XML support as well as a lot of plugins available.

Author

Commented:
Hi Guys,
Here is the schema I have.
ste5anSenior Developer
CERTIFIED EXPERT

Commented:
Can you also post your XML or a sample showing the error?
Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
As I said before, the error is in the schema and the schema is not complete

There is two imports in the schema
	<xsd:import namespace="urn:us:gov:treasury:irs:common" schemaLocation="../COMMON/IRS-CAC.xsd"/>
	<xsd:import namespace="urn:us:gov:treasury:irs:ext:aca:air:ty18" schemaLocation="../EXT/IRS-EXT-ACA-AIR-1094BC.xsd"/>

Open in new window


The imports refer to a local file
The schema will not validate unless you have the files exactly there
AND make sure the referenced schema files don't have other imports (they will likely have)
Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
I found the first schema in this github repo
https://github.com/sangramjadhav/irsclient/blob/master/model/src/main/resources/schema/COMMON/IRS-CAC.xsd
not sure that is an official one
If I look at the filestructure, there is a whole bunch of extra files
you can download the IRS client and that will give you all the schema files

I downloaded them, validated them and compared to your upstream message file... yours is 4 years more recent, but it could help if you can't get the official ones

Author

Commented:
Hi Guys,

Thank you for the feedback. I've got the 2 missing files that Geert said I was missing.
What location do I need to place them in order for them to be read?
Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
the location is in the import statement
../COMMON/IRS-CAC.xsd
means IRS-CAC.xsd needs to go from the schema, one level up in a folder that you name "COMMON"
../EXT/IRS-EXT-ACA-AIR-1094BC.xsd
means IRS-EXT-ACA-AIR-1094BC.xsd needs to go from the schema one level up in a folder you name "EXT"

you will need to check for import or include statements in those two files too

Author

Commented:
I've checked and those files are in the appropriate folders.
I've attached a screenshot.
Do you know what else I need to do?
Xml-files-and-paths.docx
Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
Now validate again using the Upstream xsd and see what happens

Author

Commented:
I'm getting the same error.
Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
Well.... then there is something wrong in the package
Can you tell us where to get the package so I can check with oxygen xml
Information Architect
CERTIFIED EXPERT
Top Expert 2006
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi Geert,
I re-downloaded the files from the IRS.
I just wanted let you know how I'm trying to test this.
There are to files my system generates: 1094C_Manifest_1_* and 1094C_Request_*
I open these 2 files in Notepad++ and open the 2 files I've attached to this thread.
I then go to Notepad++ and go to -Plugins--XML Tools --Validate.

I navigate to the directory where the IRS-Form1094-1095CTransmitterUpstreamMessage.xsd file is and get the following error message:
Validation of current file using XML schema:
ERROR: Element '{urn:us:gov:treasury:irs:msg:acauibusinessheader}ACAUIBusinessHeader': No matching global declaration available for the validation root.

Can you let me know what step I'm missing?
IRS-Form1094-1095CTransmitterUpstrea.xsd
IRS-EXT-ACA-AIR-1094BC.xsd
Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
The notepad++ XML validator is an acceptable home and school tool for easy stuff
It is simply not powerful (and compliant) enough to deal with this complexity
The validation error is likely not caused by the data, but by the lack of conformance of the tool you are using.
I do use notepad++ XML plugin sometimes, but definitely not for xml with this complexity

Step one (as suggested before): try the sample files from the package (they are valid) and validate them against the schema
You will likely get the same error. Time to get decent tools then

Author

Commented:
Thanks for all the help guys. I finally got it to validate.
I just had one additional question and i'll open another thread for it.

I got the following message. Anything off the top of your head of how I can resolve this?
ERROR: Element '{urn:us:gov:treasury:irs:ext:aca:air:ty18}TotalEmployeeCnt': '' is not a valid value of the atomic type '{urn:us:gov:treasury:irs:ext:aca:air:ty18}TotalNumberType'.
ERROR: Element '{urn:us:gov:treasury:irs:ext:aca:air:ty18}TestScenarioId': [facet 'pattern'] The value 'T2018-1' is not accepted by the pattern '([1-9]|[1-9][0-9])C{0,1}-([0-9]|[1-9][0-9])'.
ERROR: Element '{urn:us:gov:treasury:irs:ext:aca:air:ty18}TestScenarioId': 'T2018-1' is not a valid value of the atomic type '{urn:us:gov:treasury:irs:ext:aca:air:ty18}TestScenarioIdType'.
ERROR: Element '{urn:us:gov:treasury:irs:ext:aca:air:ty18}TestScenarioId': [facet 'pattern'] The value 'T2018-2' is not accepted by the pattern '([1-9]|[1-9][0-9])C{0,1}-([0-9]|[1-9][0-9])'.
Gertone (Geert Bormans)Information Architect
CERTIFIED EXPERT
Top Expert 2006

Commented:
the error messages are pretty explicit
* T2018-1 should be of the form  99C-99 (as an example)
* check what is TotalNumberType in the schema and see if you adhere to that

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.