473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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 4409
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:schemaLocation 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.xsd - CLR config files
wshmeta.xsd - Windows Scripting Host

VS Core & MSBuild Schemas
addinschema.xsd - VS Addins
itemtemplate.xsd - Item templates
vstemplate.xsd - General templates
projecttemplate.xsd - Project templates
snippetformat.xsd - Code snippets
microsoft.msbuild.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.xsd - Ad Rotator v 1.0 files
sitemapschema.xsd - 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*****@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.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 "Development Tools and
Languages\Visual Studio\Tools and Features\Working 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
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>...
9
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...
0
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...
1
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...
7
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...
2
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. ...
3
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")...
5
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.