Embarrassingly basic computer stuff that you cannot do

Message Bookmarked
Bookmark Removed
Not all messages are displayed: show all messages (90 of them)

I don't get XML.

No, I mean, I get the basic structure of XML data, I get that it is a neat but inefficient cross-platform standard that should theoretically be easy to parse, but it's had all these extra layers of complications put on top like namespaces and DTDs and XSLT until it isn't easy to parse any more and you have to use a 3rd-party library that does it properly rather than trusting your code, and I don't even know what all this stuff is or what it does or why I want it.

But I'm going to have to learn, because our new database churns out giant bloated xml and xsl files with thousands of empty tags in where I used to just get a plain old CSV out of the old database.

sambal dalek (a passing spacecadet), Thursday, 9 June 2011 12:42 (twelve years ago) link

namespaces - yeah

dtds - well they came first, it's an sgml thing and xml is an sgml. but on the whole you don't need to bother with them

xslt - my favourite language for transforming xml to xml. pretty easy to get the basic hang of, hidden depths.

ledge, Thursday, 9 June 2011 12:48 (twelve years ago) link

xml is an sgml

xml is a subset of sgml, i mean, probably.

ledge, Thursday, 9 June 2011 12:48 (twelve years ago) link

Can you recommend a good book/website for learning the basics of xslt?

I thought I knew what a DTD was from my long-gone html monkey days, but it turns out that a DTD to an html monkey is "that thing you copy the link to off the w3c site so its validator gives you a nice green tick" and a DTD to me now is "one of the files you can't find and which may not exist anyway that your XML editor (which you don't even know how to work anyway) shouts at you repeatedly about"

sambal dalek (a passing spacecadet), Thursday, 9 June 2011 13:05 (twelve years ago) link

unless your xml actually has a dtd and absolutely needs to be valid, just use a text editor maaaaaaan. one with decent syntax highlighting (editplus!!!) should inform you of most well-formedness errors.

xslt, i normally go to the horses mouth http://www.w3.org/TR/xslt or the xslt faq http://www.dpawson.co.uk/xsl/sect2/sect21.html - might not be so helpful if you're starting from scratch though, i dunno i'm sure o'reilly will have something to help you out.

ledge, Thursday, 9 June 2011 13:10 (twelve years ago) link

Ah, I didn't know (though maybe I should've) that it was covered on w3.org. That looks helpful, thanks. And if it isn't, at least I'll have more idea of what I need from a book...

(adds EditPlus to the list of text editors to try now that I can't persuade someone else to pay for UltraEdit for me and TextPad keeps crashing)

sambal dalek (a passing spacecadet), Thursday, 9 June 2011 13:22 (twelve years ago) link

(<oblig vim mention>)

koogs, Thursday, 9 June 2011 14:59 (twelve years ago) link

if you can't use vim then that should go on this list too

caek, Thursday, 9 June 2011 15:01 (twelve years ago) link

"i can't use vim"

*awkward*

caek, Thursday, 9 June 2011 15:01 (twelve years ago) link

(vim is terrible at xml, especially large files with no newlines as the syntax highlighting makes the machine grind to a halt. there is a plugin that adds functionality like auto tag completion but it breaks other vim functionality (iirc the . repeats half of the last tag completion command or the paste buffer gets dirtied, something like that))

koogs, Thursday, 9 June 2011 15:16 (twelve years ago) link

but yes, xslt is almost fun. and often frustrating, especially if you are anal about whitespace in the output file

koogs, Thursday, 9 June 2011 15:17 (twelve years ago) link

vim: install snipmate and supertab = sorted.

caek, Thursday, 9 June 2011 16:00 (twelve years ago) link


You must be logged in to post. Please either login here, or if you are not registered, you may register here.