Jump to content

Xml/dtd Validator


compositor
 Share

Recommended Posts

The (X)HTML validator at W3C is actually called "Markup validator" exactly because it can check an XML file with any DTD.In addition to using that validator, you may also use a validator that comes within your environment. IE validates XML files upon parsing them (by default, this can be turned off), Firefox may do the same, PHP can do it with the DOMDocument::validate() method, etc.

Edited by boen_robot
Link to comment
Share on other sites

The (X)HTML validator at W3C is actually called "Markup validator" exactly because it can check an XML file with any DTD.
Hi & thanks for replying.Are you saying that I can upload a dtd or it must be publicly available?What I'm hoping for is for the w3cschools idea to be implemented at w3c so it is easier to validate custom files.I'm using this program called Open XML Editor, and it does validation but I need something more, as well to extend xhtml without needing to be "online".Thanks again
Link to comment
Share on other sites

Hi & thanks for replying.Are you saying that I can upload a dtd or it must be publicly available?What I'm hoping for is for the w3cschools idea to be implemented at w3c so it is easier to validate custom files.I'm using this program called Open XML Editor, and it does validation but I need something more, as well to extend xhtml without needing to be "online".Thanks again
DTD validation is not a "W3Schools idea". It is an idea from W3C... they created XML, DTD, and the (first) markup validator.Yes, the DTD needs to be publically available to be validated with the W3C markup validator. However, as you've found out already, you can use another pgoram like "Open XML Editor" to validate the XML against the DTD. Both validators work in the same fashion, so you can safely develop with "Open XML Editor", validate with it offline, and once you're ready to go online, use the W3C markup validator.As I said already in my previous post, you can also use a programming language to initiate a DTD validation (see examples in previous post). The program itself doesn't need to be online, so if you need validation in your own (web or dekstop) program while being offline, you can use those.
Link to comment
Share on other sites

DTD validation is not a "W3Schools idea". It is an idea from W3C... they created XML, DTD, and the (first) markup validator.Yes, the DTD needs to be publically available to be validated with the W3C markup validator. However, as you've found out already, you can use another pgoram like "Open XML Editor" to validate the XML against the DTD. Both validators work in the same fashion, so you can safely develop with "Open XML Editor", validate with it offline, and once you're ready to go online, use the W3C markup validator.As I said already in my previous post, you can also use a programming language to initiate a DTD validation (see examples in previous post). The program itself doesn't need to be online, so if you need validation in your own (web or dekstop) program while being offline, you can use those.
Thanks once again for replying.I did manage to use the online validator but found that when you use SYSTEM, it still requires a publicly available URI.Is this a problem in the implementation since I also found that unparsed entities require both a name and an extension, or is this windows specific.Regards
Link to comment
Share on other sites

Thanks once again for replying.I did manage to use the online validator but found that when you use SYSTEM, it still requires a publicly available URI.Is this a problem in the implementation since I also found that unparsed entities require both a name and an extension, or is this windows specific.Regards
With the W3C validator, you upload your file, or link to it. Either way, the W3C validator needs to have the DTD in order to validate the XML against it.You can embed the DTD within the XML file, or you can link to it from the XML file. Either way, the W3C validator will make an attempt to find the DTD based on what is in the XML.Since the W3C validator is a remote server validating your file, you need to make sure that this remote server can find out your DTD. Try to look it from that server's point of view. If I send you a file that says "validation.dtd", assuming I haven't sent you the DTD as well, can you possibly know the folder from which I gave it to you, and get the DTD yourself? No, you can't. But if I tell you "http://example.com/validation.dtd", you'll know exactly where to look, and you might just find it.I'm not sure I understand what you mean about the unparsed entities thing. An example?
Link to comment
Share on other sites

I'm not sure I understand what you mean about the unparsed entities thing. An example?
Hi and thanks.Unparsed (general) entities can only be used via attributes, however what I've found is even though you are setting an entity eg. something.gif you still must supply the extension, and I'm trying to determine if this is a windows specific issue or something where the standards have allowed a bit of leeway.I will try to get an example soon.About the validator, it's interesting I never knew it could validate plain xml, that is very helpful but it could be a bit more informative with the text/xml business ie by giving you some recommendations on what to do, I mean apache being open source and all.Oh and regarding the URI, what I was saying was you specify SYSTEM and yet it is still a url you are linking to. Kind of confused me at first because I thought whenever the SYSTEM identifier was used that it had to be in the same directory or is this only for general unparsed entities.Regards Edited by compositor
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...