11

There’s just no love for XSLT. Some people tell me it’s not even a language.

Comments
  • 0
    Any benefits over CSS? I've always seen it as an XML'ified version of CSS
  • 2
    @3rdWorldPoison Think you are confusing xpath with xslt here.
  • 5
    @hjk101 Isn't Xpath just an addressing mechanism?

    Also thanks @devphobe for introducing me to XSLT. Quite a relic. I didn't know we had such good templating with XML.

    Also sorry for calling it CSS lmao :D
  • 1
    @3rdWorldPoison for selection yes. Like css selectors. It's the part that is comparable and sometimes used interchangeably.
  • 1
    XML itself is way too verbose even for a schema-less encoding. If you already have a schema, structure descriptions should occupy 1 byte per variable-length element and 1 byte per optional element per message. Maybe a bit more if your encoding can do funny things, but definitely not as much as XML. In comparison, JSON is relatively low price for readability.
  • 0
    So XSLT still is a thing?

    Fifteen years ago, when i saw a single specimen, most already believed it to be extinct in the wild...
  • 2
    i actually kinda liked it when i discovered it, moreover at the time when i got probably the only project where using it seemed to make sense:

    get xml data from a service, xslt it into a html page presenting it in a nice way.

    it was cool, while i was being ot that single project ever where using it made sense.
  • 0
    @3rdWorldPoison see my comment above this one.
  • 0
    I actually used it once to generate HTML and PDF from xml-serialized objects. Was quite handy. Though it is veeery old and finding good documentation seems almost impossible.
  • 0
    @hjk101 Err, no. XSLT is a way to show formatting for XML documents. Just like CSS. Just a lot less featureful.

    Xpath is just an addressing mechanism, as @3rdWorldPoison stated.
  • 2
    @Demolishun CSS is turing complete as well. Being "turing complete" is an incredibly low bar, by the way. I don't see how it has anything to do with CSS vs XSLT, either.

    XSLT just transforms XML, usually for display purposes. It formats XML data in whatever target medium you want. That's why XSLT documents are called "stylesheets". It serves the same purpose as CSS, even though CSS is a bit less generic than XSLT.
  • 2
    @junon The T of transformations makes it something different than a view/display adaptation as CSS does in my opinion. There a of course similarities amoung them the selecting/addressing of elements but CSS has no power over the data and structure.
  • 0
    @hjk101 CSS has power over the data with `content` and I'm not sure what you mean by 'structure' here.

    Also, it doesn't matter. XSLT was invented primarily for displaying XML in other media/presentations. We can argue semantics all day; there's not much else to argue over, however.
  • 0
    @Demolishun XSLT doesn't change the original data either. You need XML + XSLT -> output.

    Again, we're arguing semantics here, which is pointless.
  • 0
    @Demolishun You are completely right one worked for a company where you can upload docx and odt files XSLT is used for processing it into the required data structure. It's you would diff the original XML with the output you would get back almost every line changed.

    Even CSS content does not do anything with the DOM it's a real time display only thing. Perhaps there is an CSS processor implementation out there that actually transforms html but I have never seen it. Have seen quite some XSLT implementations used as filter, fixer (for Adobe InDesign crappy output) and plain text/PDF converter.
    In fact I've never used it seen it used just displaying stuff differently (without storing the altered output).
Add Comment