Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / March 2004

Tip: Looking for answers? Try searching our database.

XmlValidatingReader ERROR !!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sxMinister - 06 Mar 2004 21:16 GMT
Hi

I need to validate a XML Document using the W3C XForms Schema

I'm doing it like thi

reader = new XmlValidatingReader(xml, XmlNodeType.Document, null)
reader.Schemas.Add(XmlSchema.Read
         new FileStream("XML-Events-Schema.xsd", FileMode.Open), null))
reader.Schemas.Add(XmlSchema.Read
         new FileStream(@"XForms-Schema.xsd", FileMode.Open), null))

The first add method works with no problem but the second one gives me an erro

"Restriction of anySimpleType is not allowed. An error occurred at http://www.w3.org/2001/XMLSchema.xsd, (1447, 5).

Thanks
Ayaz Ahmed - 18 Mar 2004 10:31 GMT
Hello,

Imports System.Xml
Imports System.Xml.Xsl

Public Class WebForm1
   Inherits System.Web.UI.Page
   Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
   Protected WithEvents Button1 As System.Web.UI.WebControls.Button
   Protected WithEvents RadioButtonList1 As
System.Web.UI.WebControls.RadioButtonList
   Protected WithEvents Button2 As System.Web.UI.WebControls.Button
   Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
   Protected WithEvents DropDownList1 As
System.Web.UI.WebControls.DropDownList
   Protected WithEvents ListBox1 As System.Web.UI.WebControls.ListBox
   Protected WithEvents ImageButton1 As
System.Web.UI.WebControls.ImageButton
   Protected WithEvents Button3 As System.Web.UI.WebControls.Button
   Protected WithEvents Calendar1 As System.Web.UI.WebControls.Calendar
   Protected WithEvents TextBox3 As System.Web.UI.WebControls.TextBox
   Protected WithEvents Xml1 As System.Web.UI.WebControls.Xml

#Region " Web Form Designer Generated Code "

   'This call is required by the Web Form Designer.
   <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

   End Sub

   Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
       'CODEGEN: This method call is required by the Web Form Designer
       'Do not modify it using the code editor.
       InitializeComponent()
   End Sub

#End Region

   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
       'Put user code to initialize the page here

   End Sub

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
       Dim parameter As New XsltArgumentList()
       parameter.AddParam("calories", "", TextBox1.Text)
       Xml1.TransformArgumentList = parameter
       Xml1.Visible = True
   End Sub

   Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
       Dim readxmlfile = New DataSet()
       readxmlfile.ReadXml(MapPath("countries.xml"))
       RadioButtonList1.DataSource = readxmlfile
       RadioButtonList1.DataValueField = "value"
       RadioButtonList1.DataTextField = "text"
       RadioButtonList1.DataBind()

       Dim a As Integer

       For a = 1 To 4
           DropDownList1.DataSource = readxmlfile
           DropDownList1.DataValueField = "value"
           DropDownList1.DataTextField = ("text")
           DropDownList1.DataBind()

           ListBox1.DataSource = readxmlfile
           ListBox1.DataValueField = "value"
           ListBox1.DataTextField = ("text")
           ListBox1.DataBind()

       Next

   End Sub

Thanks,

Warm Regards,

Ayaz Ahmed
Software Engineer & Web Developer
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Karachi, Pakistan
Mobile      +92 300 2280950
Office      +92 21 455 2414
sxMinister - 21 Mar 2004 09:52 GMT
What do you mean with this post ???

> Hello,
>
[quoted text clipped - 88 lines]
> Mobile      +92 300 2280950
> Office      +92 21 455 2414
Ayaz Ahmed - 22 Mar 2004 05:18 GMT
Hello,

the meaing of post is how to read xml file through xml reader and how to
pass parameter in xml.

thanks,

Warm Regards,

Ayaz Ahmed
Software Engineer & Web Developer
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Karachi, Pakistan
Mobile      +92 300 2280950
Office      +92 21 455 2414

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.