473,396 Members | 1,853 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,396 software developers and data experts.

Validating using external DTD

Hi all,
I have an XML which comes through a HTTP request. I want to
validate that
XML with a DTD in the local machine. That XML does not have a DOCTYPE
element by itself. Can someone tell me how this can be accomplished
using
xerces java.

I had tried the sample "XMLGrammarBuilder.java" which comes with the
xerces
package. But this one seems to validate the XML only if it had the
DOCTYPE
element referencing the DTD. If I removed the DOCTYPE from the XML and
ran
the program, it gives an error such as "[Error] test.xml:2:12:
cvc-elt.1: Cannot find the declaration of element
'<the_root_element>'". But the XML is valid.

If someone has a sample, it would be of great help if you can share it
with
me.

Thanks,
Anand
Jul 20 '05 #1
0 1618

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

Similar topics

1
by: DP | last post by:
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...
2
by: and | last post by:
Hi I have been validating all day most things are cool but I cant get by this problem. One I have listed the script (JAVASCRIPT ) in all the right placesnot a prob but the validator insists...
12
by: Claire Lescarret | last post by:
Hello, I have devoted my time to write valid html 4.01 strict, and CSS-1 and 2 *but* I also have to use third party's code for webcounter (StatCounter) and Google's SiteSearch, which are...
0
by: Aaron P Frenger | last post by:
Hello All, I have a very large XML file that I would like to split up into a few smaller files, but still use only one schema. I am using Xerces C++ libraries. My idea is to have one schema...
0
by: Elias Farah | last post by:
G'day People, I am wondering what is the general concensus about the best way of validating URLs stored in a ms-access table. I can't figure out any VB methods, however I have come across some...
0
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls...
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...
5
by: rpseguin | last post by:
Ok. I've looked at expat, libxml, ... Too much baggage! I would like to find a small XML walker/"parser"/reader that simply gives me callbacks (C++ or C). No validation needed or wanted. I...
0
by: Lucilue2003 | last post by:
Hello, I need help validating an xml file against an external DTD. The below code allows me to read the xml file and gather specific elements of interest. If the xml looked like this, How...
2
by: Peted | last post by:
Hi if i derive a reference to a control on a winform (ie Control activeControl = somecontrol on the form) how can i test if that control has a validating or validated event and more importantly...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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,...

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.