473,761 Members | 9,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I use schemas on my desktop?


Hello. I'm new to using XML/HTML. I am trying to learn to validate
xml sample docs against schemas. I have an XML and Schema file (.xsd)
saved to my desktop. Below is my sample code, which is borrowed from
the .NET help files. It blows up when I try to refererence a schema
that is on my desktop.

If you can, please correct my misunderstandin g about referencing
schemas, as evidenced in the below example. Am I attempting the
impossible, or just attempting the possible wrongly?

Thanks for any help,

MWG
Imports System
Imports System.IO
Imports System.Xml
Imports System.Xml.Sche ma

Public Class validationhandl er

Public Shared Sub callvalreader()
Dim stream As New FileStream("C:\ Documents and
Settings\mgoold \Desktop\Input\ xmlexample.xml" , FileMode.Open)
Dim vr As New XmlValidatingRe ader(stream, XmlNodeType.Ele ment,
Nothing)

'HERE IS WHERE THE CODE THROWS AN ERROR:
vr.Schemas.Add( "\\Document s and
Settings\mgoold \Desktop\Input\ Schematrial.xsd ", "//C:/Documents and
Settings/mgoold/Desktop/Input/Schematrial.xsd ")
vr.ValidationTy pe = ValidationType. Schema
AddHandler vr.ValidationEv entHandler, AddressOf
ValidationHandl er

While vr.Read()
End While
Console.WriteLi ne("Validation finished")

End Sub

Public Shared Sub ValidationHandl er(ByVal sender As Object, ByVal
args As ValidationEvent Args)
Console.WriteLi ne("***Validati on error")
Console.WriteLi ne("Severity:{0 }", args.Severity)
Console.WriteLi ne("Message:{0} ", args.Message)
End Sub

End Class

Aug 4 '06 #1
0 1068

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

Similar topics

0
1426
by: kyancy | last post by:
Hello All. We have several XML schemas to describe common component document parts. We then create new XML schemas as necessary that use "xsd:import schemaLocation=whateverLocation.." to include the common type definitions from 1 or more of the component XML schemas rather than just explicitly adding the common definitions in every XML schema we create. This works great from a definition and validation point of view, but I
30
9853
by: btober | last post by:
Whenever I create a temporary table, with something like CREATE TEMPORARY TABLE temptable1 AS SELECT * FROM paid.ad_hoc_query; New schemas appear, with names like "pg_temp_1". I guess the appearance of these schemas with "temp" in the name indicates that they are "temporary" schemas and related to the temporary table creation, but the schemas persist even after the end of the session in which the temporary table was created.
7
1607
by: Roderick A. Anderson | last post by:
I'm looking for some input on a configuration I'm implementing. The long term goal is to providing hosting for companies and organizations with a basic/generic set of applications that use PostgreSQL. Most of these applications want to be installed in their own database. Given I'm looking at 6 or so already this would be 6+ databases per company. Not my idea of an easy to admin situation. My plan is to make one database (per...
4
1693
by: anonymous | last post by:
When I use the schema collection to apply many schemas to one XML instance document, I get an error if I do not qualify every element with the appropriate namespace. Both the W3C site and this article (http://www.xfront.com/ZeroOneOrManyNamespaces.html) imply that I can submit an XML instance without having to qualify each element. How do I accomplish this while still using .Net & the
2
1285
by: John Jenkins | last post by:
Hi, I have a lot of schemas to load into a schema collection. I load them in by reading each one into a XMLTextReader from disk and add them into a schema collection. I have a couple of issues to contend with. 1. The targetnamespace on all the schemas (except ones which define generic types) are the same. 2. The DefaultNamespace is the same as the Targetnamespace (I think this should be ok) 3. Some of the schemas import other sschemas...
1
1582
by: CSN | last post by:
I have two machines between which I exchange dumps a lot. On the first (Windows/cygwin), pgsql was set up with "Administrator" as the main superuser - who owns all schemas in template0 and template1. On the second machine (Linux), "postgres" is pgsql's main superuser. On whatever machines I do "createdb", the owner of the schemas in template0/1 is copied over to the schemas in the new database, even when specifying the owner parameter...
6
3536
by: Dennis Gearon | last post by:
This post is as much about getting some questions answered as leaving the following definitions in the archives for the next person. After a quick perview of the web, I came up with the following: tablespaces are a hardware issue, and totally transparent to SQL execution. It is for optimization for IO, recovery, and separating user and application usage amongst disks even in the same databases. schemas are a logical issue, and NOT...
0
1903
by: Net Virtual Mailing Lists | last post by:
I've been spending the last few days converting many databases into a single schema and have completed the process, but now I'm at somewhat of an impasse as to the best way to proceed forward.... It is important for me to explain that each of these databases has a rather different structure, going forward I'm using more of an inheritance model for each new schema, but that was simply was not possible back in the day and I hope one day to...
3
4629
by: Sami Marzouki | last post by:
Hi, What I'm trying to do is: - To write a Web.config with custom sections. (Done) - To write a xsd schema for this custom sections.(Done) - Tell the Web.config to take the two schemas. When i specify the two schemas in the schemas property of the web.config, it seems that only one is token.
0
220
by: mgoold2002 | last post by:
Hello. I'm new to using XML/HTML. I am trying to learn to validate xml sample docs against schemas. I have an XML and Schema file (.xsd) saved to my desktop. Below is my sample code, which is borrowed from the .NET help files. It blows up when I try to refererence a schema that is on my desktop. If you can, please correct my misunderstanding about referencing schemas, as evidenced in the below example. Am I attempting the...
0
9554
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
9988
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...
1
9923
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
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
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
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
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.