Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML 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
 
Old June 7th, 2004, 11:59 PM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validating XML

Hi Friends,
First, I am new to the XML development
I want clarifiaction with XML that when I check my XML file againts the DTD/Schema. When ever there are say 10 error in my XML file it gives only me the first error encounter Is it possible to get all errors at a time so client will fill the information and send the completed XML file instead of only 1 error and other 9 error remain unsolved

could any one have solution for above problem

 
Old June 8th, 2004, 06:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

How are you using the XML? If you are viewing the XML in the browser, and an error is encountered, the browser is only going to return the first error. Are you using a programming language for this XML?

Thanks,

Brian
 
Old June 8th, 2004, 11:48 PM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by bmains
 Hello,

How are you using the XML? If you are viewing the XML in the browser, and an error is encountered, the browser is only going to return the first error. Are you using a programming language for this XML?

Thanks,

Brian
First of all Thanks for your reply
I am using the VB.Net as I dont want to play with client
only sending a single error at time it very much tedious
if i use my own parser for it because it is very tedious
to write own parse and will solve my problem
If there is solution then this might be the requirement
for others because it is frequently needed and it is not
possible to write own parser all time

Thanks
Sunil


 
Old July 13th, 2004, 12:11 AM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Friends
First of all thanks to your kind replies.
Here I got the solution in .NET
For simplicity I have used message box and validated the XML document againt the DTD

' type of validation DTD
validRd.ValidationType = Xml.ValidationType.DTD

        ' iterate through each node of the xml file
        While Not validRd.EOF
            Try
                ' read the next node of xml file

               validRd.Read()

            Catch err As Exception
                ' check for if any exception i.e. error in xml file
                ' add error to error message
                ErrorMsg = ErrorMsg & (err.Message) & vbCrLf

            End Try
        End While
        ' show the error message
        MsgBox(ErrorMsg)

If any one get the better solution or suggestion please the post the reply

Sunil Yenpure






Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Validating one XML value against another spinout XML 3 August 27th, 2008 01:35 PM
validating xml m_rajib C# 0 May 5th, 2006 12:53 AM
Validating XML against XSD ShaileshShinde General .NET 0 September 20th, 2005 01:22 AM
Validating Xml files with XSD file ShaileshShinde VB.NET 2002/2003 Basics 1 September 12th, 2005 07:00 AM
Validating XML Schema lmadhavi XML 0 November 18th, 2004 06:58 AM





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