XML/XSLT question (very general)

I learn best when I can make good analogies, so please tell me if I’m on the right track here:

Very broadly speaking, XML lets you build a database and XSLT is a reporting module that allows you to run various kinds of reports and extracts off that database.

Anything close to right?

Neither one is really oriented more towards databases than anything else. XML is a markup language, it keeps data in standard general syntax. XSLT is a means of transforming data that is in XML format. Look at what the letters in the names tell you: XML - eXtensible Markup Language, XSLT - eXtensible Stylesheet Language Transformations.

Nope. XML is simply a bunch of rules about how to define a markup language, nothing to do with creating databases. You can certainly store “XML” documents in a database but that’s not its real purpose.

Nope. XSLT is for transforming XML documents into another type of XML document, it isn’t a reporting tool like SQL. You can use XSLT to extract stuff from an XML document but the process is nothing like running a database query.

If you substitute SQL(DDL) for XML and SQL(DML) for XSLT that would be true.

Thanks to you both.

I would say that is certainly one of the ways in which you could use XML and XSLT together, and if “database” and “report” are construed fairly broadly, it probably covers virtually all the ways you would be likely to use them in practice. (I am open to being corrected on this, but if you intend to do so, please provide an example of a practical use of XML that cannot reasonably be construed as a way of organizing data, and of XSLT that cannot reasonably be construed as a way of extracting information that is stored as XML.)

So yes, I think that, even if not 100% technically correct, for someone starting out with XML and XSLT what you suggest is a good analogy, or at any rate a helpful model to have in your head, and it is probably not helpful, for a beginner, for experts to get too nitpicky about it.

Thank you, njtt! You’re seeing it very much from the perspective I was when the analogy came to me.

Fortunately, they didn’t even ask about XML/XSLT at the job interview, so I was spared from having to trot out an analogy that clearly is a little shaky. :slight_smile:

KneadToKnow, why don’t you tell us a little more about this job and how XML and XSLT apply? We might be able give you some better information without getting all ‘nitpicky’ about it.

I wouldn’t go so far as to say that any way of organizing data is a database, but I would certainly count serializing a list of objects to and from an XML file as a database. Just not of course a RDBMS.