473,772 Members | 3,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to specify a local (!) Schema file in the same (!) directory as the xml file ?

I would like to validate a xml file against a xsd file on my hard disc.
Ok, I could specify the location of the XSD Schema in the instance of the xml file as follows:

<Person xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xsi:noNamespace SchemaLocation= "file:///D:/tmp/Personschema.xs d">

It works.
But I would like to specify the location of the xsd relative to the xml file.
That means if I move both xml AND xsd schema to another folder the xml file becomes invalid resp.
the validation fails because of a missing xsd file.
On the other hand if i change the Schema location as follows:

<Person xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xsi:noNamespace SchemaLocation= "Personschema.x sd">

The XSD file is not longer valid itself because "Personschema.x sd" is not a valid URI.
So is there another method to specify the Schema location relatively to the xml file ?

Till

Jul 20 '05 #1
1 25041
ts***@arcor.de (Till Soerensen) writes:
I would like to validate a xml file against a xsd file on my hard disc.
Ok, I could specify the location of the XSD Schema in the instance
of the xml file as follows:
</snip/>
<Person xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "Personschema.x sd">

The XSD file is not longer valid itself because "Personschema.x sd"
is not a valid URI.


It's fine -- it's a (relative) URI reference, which is allowed, and
should work with any conformant schema processor.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1831
by: Bill | last post by:
Using ASP in a VBScript environment, how can I check the protection on a directory, or a particular file?
0
1398
by: Ollie Riches | last post by:
I am executing a DTS programmatically from C# using COM interop. Is it possible to set the 'script file directory' from the C# code? For anyone else you gets an 'Access Denied Error' when attempting to run a DTS package from code it is because the local machine attempting to run the remote DTS package does not have the 'script file directory' defined on the local machine. Cheers
4
1883
by: Sindarian | last post by:
This just seems like the most basic thing, but I can't find a simple description of this process anywhere and in here, everone is talking about going the other way :( I had .NET create an XML Schema file (xsd) for a table in my database. I then create a DataSet that contains 1 row of data from that same table. I want to use this DataSet along with the Schema file to create an XML file that ACTUALLY CONTAINS THE DATA. Simple huh: DataSet +...
0
1211
by: Rajiv Das | last post by:
..Net 2.0 --------- Assume I am on a non-domain network. The proxy asks me to authenticate whenever I want to access the net. I have an app, through which I wish to access web sites using HttpWebRequest. Now in the config file snippet below: <system.net> <defaultProxy useDefaultCredentials="false">
2
3098
by: Antonio-F100 | last post by:
Hello, I need help creating the code for a macro button on a form that will open a file directory with windows explorer. I have about 500 directories with very long names and only want to input part of the directory name into the table that the form uses.
2
2500
by: Jeff Gaines | last post by:
As part of learning php I have set up an automated directory/file listing process. On my server I have a directory called 'Notes' and under that a dozen or so dub-directories on various topics, each containing a mix of html and mht files. In the Notes directory I have a php script which echoes links to each sub directory (excluding . and ..) and incorporates a link to a file 'index.php' in each sub directory.
7
2632
by: anupkkumar | last post by:
Hi All, Is there any way to copy a file/ directory from one location to the other? The file or the directory name should be given by the user. This is the criteria. For example: My.Computer.FileSystem.CopyDirectory("C:\abc\<file/dir>", "D:\cde\<File/dir>") Here the file/dir should be obtained from the user during runtime. Please let me know the code or the logic. Thanks,
1
11746
by: DeanB | last post by:
Please excuse my ignorance here as I have not used WPF for long, but what is the statement that tells what the "local:" identifier is that allows a window event to call a function in a .cs file? Here is the top of a window definition in xaml: I've marked the area in question with ?????. I have to call the TypeDirectoryValidationRule function from within the xaml code. I'm also confused on what the "SomePath" string is supposed to be for....
8
14949
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to cut and paste code that MSDN recommends for playing a simple wav file from inside an embedded file, like presumeably the 'resources' file .resx is. I want to embed the .wav file in a 'resource file' since I don't want the user storing the file on...
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.