Solved

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
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, …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 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