Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do you deal with accents and special characters in XML load to SSIS package 2 86
Merging XML files via VB Script 4 79
Specific format 21 181
Test ddwrt:UserLookup 1 53
The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

930 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

14 Experts available now in Live!

Get 1:1 Help Now