Solved

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

Posted on 2007-04-06
5
1,611 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 250 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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