Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an XML document which references a single XSD schema file which are both in the same directory. When referencing the schema in the XML file, is it possible to use a relative URL? If not, is there a way round the problem of having to maintain different versions of the XML file on my local development machine and on the production server?


Kind wishes, Patrick
Posted

Not a problem:

HTML
xsi:schemaLocation="http://MYNAMESPACE ../../folder/relative/schema.xsd"


But remeber: http://MYNAMESPACE must be replaced with the targetNamespace URI of your schema.
 
Share this answer
 
Got it now, thanks. Your reply puts my mind at ease because I had read a lot of (sometimes) contradictory information on schemas, and at least one website I visited said something about relative URLs not being allowed and most only gave explicit full URLs.

I think my local working copy was actually working but the Visual Studio Intellisense just hadn't got it until I explicitly added my schema.



- Patrick
 
Share this answer
 
Comments
Dave Kerr 12-Oct-11 15:54pm    
Cool glad you've got it working :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900