473,856 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Do you have to be online to validate XML against a W3C schema?

Hi

Apologies if this is a really dumb question, but being new to XML and
Schemas, I wonder if giving the namespace for eg xsd or xsi as a website
address means that the user has to be online when they run the app? If so,
what should I do if I can't guarantee that they will be? Can I bring all
these files into the app? Is that desirable?

I'm about to write an app that takes an XML file as input, using Visual
Studio 2005 Express and SQL Server 2005 Express, and I have to create a
schema that combines various standard ones that live on the net.

Thanks very much for any help.

Lesley
Nov 12 '05 #1
6 4442
Hello!

You can use XmlResolver to redirect the www.w3.org... requests to the
users hard-disk.
--
Pascal Schmitt
Nov 12 '05 #2


LesleyW wrote:
Apologies if this is a really dumb question, but being new to XML and
Schemas, I wonder if giving the namespace for eg xsd or xsi as a website
address means that the user has to be online when they run the app? If so,
what should I do if I can't guarantee that they will be? Can I bring all
these files into the app? Is that desirable?


Using a URL for a namespace is simply a way to have globally unique
name, there does not have to be any resource at that URL and you can
certainly validate for instance some XHTML with
<html xmlns="http://www.w3.org/1999/xhtml">
without ever needing to access the URL http://www.w3.org/1999/xhtml.

But of course if you want to validate against a schema then the
validator needs access to the schema and if you want to validate against
a schema residing somewhere on http://www.w3.org/ then you either need
to enable the validator to read the schema from there or you need to
make a local copy of the schema and make sure the validator works with
the local copy. As schema validation intentionally allows for validation
against a schema not linked to in the XML document (any
xsi:schemaLocat ion is only a hint) any validating parser supporting
schemas has an API that allows you to specify the schema(s) against
which to validate thus if you have local copies of the schemas needed
you can simply instruct the parser to use these by making the right API
calls.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #3
Thanks for the replies.

So in VS 2005, are the standard W3C schemas already local and I just have to
copy in any others?

Is there a good source that describes how this works? I've been hunting for
days and can only find snippets here and there.

Many thanks again.

LesleyW
Nov 12 '05 #4
Hi Lesley,

The XML Editor in VS2005 ships a set of predefined schemas which are
installed into your Visual Studio Installation directory under
%vsinstalldir%\ xml\schemas (for example, C:\Program Files\Microsoft Visual
Studio 8\Xml\Schemas). These schemas describe some of the core standard XML
namespaces, as well as some of the Visual Studio specific namespaces.

When you open an XML file that uses any one of the namespaces defined by
these pre-defined schemas, the XML editor will automatically associate the
matching schema from the cache location (%vsinstalldir% \xml\schemas) and you
will immediately get validation errors and intellisense based on that
schema.

This schema cache directory is designed to hold schemas that are standard
and not likely to change. The list is as follows:

W3C & Soap Schemas
soap.xsd - Simple Object Access Protocol 1.0
soap1.1.xsd - Simple Object Access Protocol 1.1
soap1.2.xsd - Simple Object Access Protocol 1.2
wsdl.xsd - Web Service Description Language
xenc.xsd - XML Encryption
xhtml.xsd - XHTML 1.0
xlink.xsd - XML Linking
xml.xsd - Core XML attributes (xml:lang, xml:space, etc).
xmlsig.xsd - XML Digital Signatures
xsdschema.xsd - XSD for XSD
xslt.xsd - XML Transformation Language 1.0

WebData Schemas
msdata.xsd - ADO.NET XSD annotations.
datasource.xsd - <DataSource> XSD extensions
xdr.xsd - XML Data Reduced (SQL 2000)
xdrrowset.xsd - ADO recordset persistence XDR extensions
xdrtypes.xsd - Primitive types for XDR
msxsl.xsd - XSLT extensions for System.Xml.Xsl.

CLR & Windows Schemas
dotnetconfig.xs d - CLR config files
wshmeta.xsd - Windows Scripting Host

VS Core & MSBuild Schemas
addinschema.xsd - VS Addins
itemtemplate.xs d - Item templates
vstemplate.xsd - General templates
projecttemplate .xsd - Project templates
snippetformat.x sd - Code snippets
microsoft.msbui ld.xsd - MSBuild schema
catalog.xsd - The XML Editor schema catalog format
vsIntellisense. xsd - XSD Intellisense extensions for XML & HTML editors.

Venus & Mobile Controls Schemas
adrotator.xsd - Ad Rotator control files
adrotator1_0.xs d - Ad Rotator v 1.0 files
sitemapschema.x sd - WebSite maps files
xmta.xsd - Smart Devices
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
"LesleyW" <Le*****@discus sions.microsoft .com> wrote in message
news:B3******** *************** ***********@mic rosoft.com...
Thanks for the replies.

So in VS 2005, are the standard W3C schemas already local and I just have
to
copy in any others?

Is there a good source that describes how this works? I've been hunting
for
days and can only find snippets here and there.

Many thanks again.

LesleyW

Nov 12 '05 #5
Hello!

Kind of off-topic, but as you are "Program Manager, XML Technologies":

Will you add any kind of RDF-support in future .NET Versions? (And
editing support in VS.NET)? There are pretty few .NET implementations
(Drive, SemWeb, Euler.NET) and no dedicated data-store or query-engine.

Editing ontologies is a pain, an Editor for VS.NET wich is like the one
for XSD would be cool, IntelliSense (like for XML) for
RDF/XML-source-code editing too.
--
Pascal Schmitt
Nov 12 '05 #6
In VS 2005 there is are some standard schemas already provided in the box.
Check out the directory located at c:\program files\microsoft visual studio
8\xml\schemas.

If there are any more schemas you want the XML editor to always know about
automatically, just drop them in this folder. Or you can edit the
catalog.xml file in this directory to point to schemas located elsewhere on
your hard drive or LAN.

You can also just drop the schema in your Project (or Solution) and the XML
editor will automatically find them there. This is handy when it is a more
specific schema that you want scoped locally to a particular project.

If you installed the VS 2005 documentation you will find the details on how
the schema association works located under "Developmen t Tools and
Languages\Visua l Studio\Tools and Features\Workin g with XML Data\XML
Editor\XML Document Validation" and also the sibling page "Schema Cache".

Chris.
"LesleyW" wrote:
Thanks for the replies.

So in VS 2005, are the standard W3C schemas already local and I just have to
copy in any others?

Is there a good source that describes how this works? I've been hunting for
days and can only find snippets here and there.

Many thanks again.

LesleyW

Nov 12 '05 #7

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

Similar topics

1
1710
by: Andy | last post by:
Hello All! Is there any way to validate XML document agains schema, but at the same time ignore any attributes or elements that are not specified in schema? Example: <Customer> <LastName></LastName> <FirstName></FirstName>
9
12478
by: Leona | last post by:
Hello all, does anyone know of a tool, preferably free, preferably on linux, which will take an xml file and validate it against your own custom W3C XML Schema file (.xsd) ?? All help appreciated - it's proving very difficult to find. Failing that, does anyone know how to get the W3C's own online validating engine (XSV, I think it's called) to do the same job? I can't get it to do what I want and I can't really understand the output.
0
1352
by: MG | last post by:
The following below is Microsoft sample to validate a XML document. My question is how can I put the validate errors in DataGrid? Using the ValidationEventHandle subroutine and adding ListBox control in that event works find but i can't firgure out to use a DataGrid instead. Can someone help, Please.? Dim m_success As Boolean Public Sub ValidationEventHandle(ByVal sender As Object, ByVal args As ValidationEventArgs)
1
2135
by: Jonas Bush | last post by:
I'm trying to validate an XmlDocument with an XSD schema, and I'm getting the following error: Could not find schema information for the element 'month'. An error occurred at , (1, 40). Here is the code I'm using for validation: System.Text.UTF8Encoding utf8 = new System.Text.UTF8Encoding(false);
7
16295
by: Ali-R | last post by:
Hi all, I am getting a CSV file like this from our client: "C1","2","12344","Mr","John","Chan","05/07/1976"......... I need to validate **each filed value** against a set of rules ,for instance for "05/07/1976" ,I need to make sure that it's in the right format ,It's not later than today and lots of other rules ,Is there somebody who can help me how to that?Can I map it to some sort of xml schema or something?
2
1787
by: John H | last post by:
Hi, How can i just use the XmlDocument object to validate an xml instanace against a schema referenced inside the xml instance? The Load method seems to not validate it against the schema. Thanks John
3
1452
by: Gilles Lambert | last post by:
Hi, i'm trying to validate a doc.xml against a schema XSD this way, but it doesn't validate anithing : Dim xrs As New XmlReaderSettings xrs.Schemas.Add("urn:mediatheque-lrvb8", "schema.xsd") xrs.ValidationType = ValidationType.Schema AddHandler xrs.ValidationEventHandler, AddressOf Validation Dim xr As XmlReader = XmlReader.Create("doc.xml", xrs)
5
6376
by: Doru Roman | last post by:
Hi, I am a beginner and I try to understand how can I use C# and Netframework to validate an XML document. Is XSD a solution? How? Thanks, Doru
6
2759
by: Jonny | last post by:
Hi, I'm trying to validate my xml against a xsd but I can't get it to work. Originally, I wanted to validate an xml string but since I didn't get that to work I tried to validate an xml file instead. Didn't work either. Actuallty, the xml gets loaded but there are no events raised that says my xml is incorrect! I'm using .NET 2.0 and my code is listed below. ALL help is appreciated! Thanks!
0
9764
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
11063
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...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7098
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
5762
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
5960
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4580
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4176
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3203
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.