Wrox Programmer Forums
|
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 16th, 2003, 11:45 PM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.NET 1.0 with VB.NET

This book has been a very useful reference. I am now using it in conjunction with Beginning XML (2nd Edition). I wanted to use ASP.NET's ValidatingReader to validate the samples in Beginning XML. On Page 798 of ASP.NET Namespace is a program to do this. It uses a DropDownList to select the XML file, but hardcodes the schema file. I thought I could also use a drop down list for the schema file. But I can't get it to work. I've used OnClick events to a) load the files and b) validate the xml file. When I validate, I get an error that: "Object reference not set to an instance of an object." It apparently refers to the XMLValidatingReader. THe code snippet is:

Dim strSchemaPath As String = Left(strCurrentPath, _
                          InStrRev(strCurrentPath, "\")) & _
                          SelSchemaFile.SelectedItem.Value


                          'create new XmlTextReader object and load Xml document
              objXTReader = New XmlTextReader(strXmlPath)
              objValidator = New XmlValidatingReader(objXTReader)
             objValidator.ValidationType = ValidationType.Schema

              Dim objSchemaCol As New XmlSchemaCollection()
             objSchemaCol.Add("", strSchemaPath)

             'assign the schema collection to the XmlValidatingReader
             objValidator.Schemas.Add(objSchemaCol)

The error is in the last line. Any help is appreciated on this or if you know another way to dynamically select the XML and schema file for validation.

Steve P.






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 1.1,VB.NET,crystal reports, SQl server gvi Crystal Reports 1 September 11th, 2008 02:55 AM
send MASS Emails in ASP.NET 2 with VB.NET 2005 alexdcosta ASP.NET 2.0 Basics 1 July 17th, 2006 12:31 AM
Parse XML doc using VB.NET into ASP.NET page kwilliams Classic ASP XML 17 November 11th, 2005 10:42 AM
call window dialog component with asp.net/vb.net s3ng ASP.NET 1.x and 2.0 Application Design 0 June 21st, 2005 04:54 AM
Beginning ASP.Net Databases Using VB.Net ISBN 6195 tlamazares SQL Server ASP 1 December 15th, 2003 01:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.