Jump to content

Avoid Attributes?


Recommended Posts

I am getting started with XML and am rather confused about the number of tutorials that are tied into this. I see... XMLDTDSCHEMAXSLTXML DOMXPATHXQUERYXLINKXPOINTERXSL-FO And then even more that are mostly related to web services. What is the logical order for going through these? I started with some homework that required XML, DTD, XSLT and Schema, so I've skimmed those topics, but now I'd like to go through this material in the proper order, from simple to complex. Any advice? I am confused about a variety of issues such as attributes. In my homework it seemed that the logical file groups that form a document are: (XML, DTD, XSL) or (XML, XSD, XSL) and then either of these can be used to produce a rendered XHTML. Is that correct? Do I need to obtain a tool or validator? Thanks.

Edited by davej
Link to comment
Share on other sites

You don't need either DTD or XSD to render XHTML from an XML document. XSLT is enough.DTD or XSD is needed to validate the grammer of an XML document. To actually perform the validation, yes, you need to use a validator.The order I'd advice is XML, (XSLT & XPath), (DOM & XPath), XSD, DTD. XPath needs to be studied together with XSLT and/or DOM, because it doesn't make sence in a vacuum. XSLT on the other hand can't really do anything without XPath. DOM could, but having the "node sence" that XPath provides helps.As for attributes - an attribute can occur once per element, and can't have any children other than its value. If you have a scenario where this is enough (e.g. specifying a URL of sorts, a "flag" of sorts, etc.), an attribute is a perfect thing to use. In all other instances, an element is more appropriate.

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
  • Create New...