Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

Monday, December 7, 2020

CSS Within XSLT - a way to simplify simple HTML generation from XSLT

It can be a challenge to keep CSS files up to date as you change XSLT transformations to produce different HTML output. You've got to remember what you changed and then work out which CSS rules are affected and update them. Removing out-of-date rules is important, and can even affect your site’s ranking in search results, but it’s hard to do and requires attention to detail.

Recently I’ve been taking a different approach and I’m finding it much more productive.

Friday, March 8, 2019

Happy Birthday, World Wide Web


On W3C, The Web, Information

The great dragon Obrfynar climbed the side of the mountain; reaching the podium, she turned to face the audience. There was polite applause, curtailed because everyone wanted to listen. She was, after all, one of the most famous dragons on the conference circuit. Mountain birds flew hastily away in case she cleared her throat, but she just took a drink of sheep’s blood from the glass on the podium and began to speak.
“We are Dragon-kind! All look to us in awe! We are the mightiest! And from the beginning of time we have known what we want, what we need, what we must have, what we will have! And what is it?”
There was a predictable roar from the crowd. Any birds foolish enough to be watching had long fled or were roasted in the excitement. The roar said one word:

“GOLD!”

We must seek gold. Wherever it is, we must find it and hoard it!”

Thursday, October 2, 2014

Some Myths About XML and RDF

It doesn't make sense to compare XML and RDF any more than it makes sense to compare poetry and paper, or a tax bill and a bottle of ink. But people do it.

XML here is like blank paper, a medium. It doesn’t give give meaning to the poem, and you could write the poem on something else, but that doesn’t diminish the usefulness and value of paper. Which brings me to the first myth, one I have heard often:

1. XML has no semantics, therefore XML cannot express RDF

This makes no sense if you think of XML as the paper, or as the electrical cable carrying a telephone conversation. Er, OK, if you’re young and use these new-fangled portable telephones, the radio waves carrying a telephone conversation.

But if it did make sense your RDF would lose all its meaning when you serialized your RDF graph as RDF/XML. When you send that XML to someone else and they reconstitute an RDF graph, they say there’s meaning in that RDF graph. How was the meaning transmittted if XML cannot store meaning?  I call this the XML Phlogiston argument.

2. XML is about trees and cannot represent graphs.

One RDF advocate accused me of not knowing what a graph was when I said this was not the case, but the existence of RDF/XML, and for that matter GraphML, proves otherwise. XML can store graphs just fine.

3. RDF lets you concatenate graphs to combine them but XML cannot do this.

This is a more subtle myth. First, you can’t concatenate two RDF/XML documents as-is, because the result would not be well-formed XML. But you can use a simple XQuery expression such as
    <rdf xmlns:ref="
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>{ doc('a.xml')/*/*, doc('b.xml')/*/* }</rdf>
to return a single combined document.

The hard part is called schema mapping or ontology matching - if one document uses vehicle, automotive, four-wheeled, short, sports-car, and another uses car, green, you can’t assume all green cars are sports cars, and no automatic combination of the graphs is possible, regardless of whether you use n3 or turtle or sparql or strawberry jam,and it’s as true in JSON and XML as in RDF.

4. XML Failed

I’ve heard this one even from colleagues, some of who believed the goal of XML was to replace HTML. That wasn’t our goal at all, and XML is doing very nicely in its original intended use of technical documentation, thank you. So this isn’t really about RDF and XML except that I sometimes hear it in that context.

Are there other RDF and XML myths?

[update: yes, no. 2 should have read, and now does read, graphs, thank you to those who pointed it out.]

Web History and SoftQuad HoTMetaL

 Years ago, starting in 1989, i worked at SoftQuad Inc. in Toronto. I got there because SoftQuad sold a text formatter based on troff (sqtr...