Solved

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

Posted on 2007-04-06
5
1,598 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
  • 3
  • 2
5 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 250 total points
Comment Utility
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
Comment Utility
how can i make it "full valid URL"?  The "lomcustom.xsd" is local to the xml.
0
 
LVL 60

Expert Comment

by:Geert Bormans
Comment Utility
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
Comment Utility
thank you....
0
 
LVL 60

Expert Comment

by:Geert Bormans
Comment Utility
welcome
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now