473,407 Members | 2,314 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,407 software developers and data experts.

validating xml by variable dtd

DP
I am requesting xml from a url. Now I want to validate this xml by a
dtd. Is it possible that i define a dtd afterwards instead of in the
xml itself? I don't like to bother the users wich provide me this url
with a dtd tag in top of the document en also things can go wrong
here.
I also want to validate different url's by different dtd wich i want
to define myself
'CODE-------------------------------------------------------------

dim xmlHTTP, xmlDomObj, xmlData
set xmlHTTP = CreateObject("Msxml2.ServerXMLHTTP.3.0")
xmlHTTP.open "POST", requestURL, False
xmlHTTP.send

' parse requested xml and make it managable via DOM
set xmlDomObj = server.CreateObject("MSXML2.DOMDocument")
xmlData = xmlHTTP.responsetext
xmlDomObj.async = true
xmlDomObj.loadXML (xmlData)
' ---??DEFINE DTD HERE?

' check if during parsing any errors were encountered
if xmlDomObj.parseError.errorCode <> 0 then
call errorOccured("Error parsing XML (error " &
xmlDomObj.parseError.errorCode & "): " & xmlDomObj.parseError.reason &
" at line " & xmlDomObj.parseError.line & " character " &
xmlDomObj.parseError.linepos & "<BR><a href=""" & requestURL & """>XML
Source</a><BR>Probably url is not returning valid xml",
"xml_handler->getXMLviaURL")
set getXMLDocument = Nothing
set getXMLviaURL = nothing
else
' return xml Dom Object object
set getXMLviaURL = xmlDomObj
end if
Jul 22 '05 #1
1 1615


DP wrote:
I am requesting xml from a url. Now I want to validate this xml by a
dtd. Is it possible that i define a dtd afterwards instead of in the
xml itself?
Not with a DTD, MSXML 4 has W3C schema support and there the schema can
be external and not referenced in the XML instance itself so script can
load a schema separately before parsing/validating the XML instance.
I also want to validate different url's by different dtd wich i want
to define myself
'CODE-------------------------------------------------------------

dim xmlHTTP, xmlDomObj, xmlData
set xmlHTTP = CreateObject("Msxml2.ServerXMLHTTP.3.0")
xmlHTTP.open "POST", requestURL, False
xmlHTTP.send

' parse requested xml and make it managable via DOM
Msxml does the 'parse and make manabable via DOM' for you automatically
so the lines below are not necessary, you can simply set
set xmlDomObj = xmlHTTP.responseXML
set xmlDomObj = server.CreateObject("MSXML2.DOMDocument")
xmlData = xmlHTTP.responsetext
xmlDomObj.async = true
xmlDomObj.loadXML (xmlData)


--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 22 '05 #2

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

Similar topics

6
by: Alex Bink | last post by:
Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data. Only if he clicks on another specific control he is allowed...
0
by: Joe | last post by:
Hi For a while now I have been finding postings of problems with the validating event not firing on controls properly. I too had this problem. The event would fire when clicking on another...
2
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
17
by: stathis gotsis | last post by:
Hello everyone, I am tying to come up with an elegant way to process some input data that come from a form. When the user hits the 'Submit' button, i want the form to appear again with the...
9
by: chuck | last post by:
I need some help with validating user input. I am writing a C computer program for an intro to C course. Here is the situation. I am creating an application that will do currency conversions. ...
21
by: Darin | last post by:
I have a form w/ a textbox and Cancel button on it. I have a routine to handle textbox.validating, and I have the form setup so the Cancel button is the Cancel button. WHen the user clicks on...
3
by: TheSteph | last post by:
Hi Experts ! I have a Winform Program in C# / .NET 2.0 I would like to ensure that a value in a TextBox is a valid Int32 when user get out of it (TextBox loose focus)
5
by: Kavya | last post by:
I saw these two ways for validating input First Way -------------- #include <iostream> #include <limits> using namespace std; int main() {
3
by: Jennifer.Berube | last post by:
okay...so I got this login script and I edited it all and it seems to run fine...IE it listens to the script as far as permissions go when I place a restriction on a page and when you login it...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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,...
0
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...

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.