Jump to content

Xmlschema And Xsl


compositor
 Share

Recommended Posts

I was wondering if it is at all possible to use the W3C validator in order to validate an XSL file against an XML Schema?Already Microsoft don't allow more than one DTD in an xml document and even though it's done by the browser I think it's fair to say that time is nigh that W3C stepped up to the plate and provided (more).Thanks & regards

Edited by compositor
Link to comment
Share on other sites

Already Microsoft don't allow more than one DTD in an xml document
It's W3C that don't allow more than one DTD. Microsoft are just following the standard.W3C aren't likely to allow anything furhter for DTDs, because DTDs are sort of "outdated", and now really only exist for entities' sake. W3C invests in XML Schema when it comes to validation. Other parties like OASIS and ISO bet on RelaxNG and Schematron respectively, but no one bets on DTDs. And why is that you ask? DTD was never designed with XML namespaces in mind, and as such, it's the least powerful validation language around. XML Schema has full support for pretty much all possible XMLs (except the case where one node's presence or value determines the possible values or existence of another node; W3C plans to cover this with XML Schema 1.1), but is extremely complex to implement and use. RelaxNG is simpler, combining the simplicity of DTD, the datatypes of XML Schema 1.0, adding XML namespaces into the mix, but is somewhat less powerful. Schematron, combined with XML Schema datatypes and XPath 2.0 is the most powerful language around (it even covers the mentioned case that XML Schema 1.0 is missing), but lacks pretty much any kind of streaming capabitilies.As for validating XSLT... you could... there is an XML Schema for XSLT 2.0. However, due to the limitations of XML Schema 1.0, I'd say that Schema is pretty much useless. XSLT can contain elements from foreign namespaces and then have XSLT elements again. XML Schema, as far as I know, can't place constrains once it lets go of the namespace. Only Schematron can. Edited by boen_robot
Link to comment
Share on other sites

Thanks for that link, I will study it when I can.Regarding Schema validation, my personal view is regardless of the perceived power of XMLSchema, the simple fact that DTD and XMLSchema can't be used together to me is silly since with DTD all you are really defining is the existence ofelements, their order, their attributes and values, as well as of course entities. You don't need to be concerned with namespaces or how many times an element can exist unless you introduce a schema into the mix but with the current implementation you can't because of a blanket ban.Anyway the reason I want to write a custom schema for xsl documents is because I am using HTML (naturally) as the rendering language with xsl templates, which is a poor mans' way to xslfo but it's fine for the current time.What I was asking was for validator.w3c.com to be able to validate xml documents against schema, otherwise what is the point. As I mentioned before I can use a simple program to validate an xml file against a DTD and it even tells me when I should use a single a attribute instead of multiple attribute definitions for the same "node" but there seems to be nothing for XMLSchema, which I believe is responsible for poor take up worldwide, but that's just my view.Regards

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...