Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

xsi:schemaLocation is causing an error (can't load the xsd)

Posted on 2007-04-06
5
Medium Priority
?
1,613 Views
Last Modified: 2008-01-09
schemaLocation is causing an error:

<?xml version="1.0"?>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM lomcustom.xsd">

It worrks when i remove the "xsi:schemaLocation" reference:

<?xml version="1.0"?>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
0
Comment
Question by:Mike Johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 1000 total points
ID: 18864044
well, your parser tries to validate the XML using the schema
the xsi:schemaLocation is the locator of the schema
It consists of two parts
The part before the space is the namespace URI
the part after the space is the schema URL
So in order for this to work, your parser has to find the physical schema at the URL
This means that Iomcustom.xsd needs to be in the same directory as the XML (if this is a local validation)
you can make it a full valid URL to make it work

If you remove the schema, there simply is no validation, just wellformednes checking
If you are happy with that, just remove the xsi:schemaLocation
but this might have some unpleasant consequences further up the chain

cheers

Geert
0
 

Author Comment

by:Mike Johnson
ID: 18873353
how can i make it "full valid URL"?  The "lomcustom.xsd" is local to the xml.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 18873361
if you have to pull the schema from a server use http://....
if it is local on disk,
use the relative uri eg. "schemas/lomcustom.xsd"
or keep the XML file as it is and put the schema in the same directory

cheers

Geert
0
 

Author Comment

by:Mike Johnson
ID: 18873964
thank you....
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 18874424
welcome
0

Featured Post

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question