A new XSLT utility, “Alternate Text Attribute Splitter” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Great idea, it has always bugged me that you couldn’t set a class in Markdown.

Cool idea indeed.

Awesome, no more HTML just so I can set a single class on a special link.

But unless I’m missing something, in its current form the utility only works with images? (Not images & links as described on the utility page.)

@Knupska - yeah, you’re right. I’ll add support for links now.

Alternate Text Attribute Splitter updated to version 1.0.1 on 8th of April 2010

Heh, that didn’t quite do it as it’s now searching for img/@title ;)

I think that img/@alt | a/@title would suffice.

Alternate Text Attribute Splitter updated to version 1.0.2 on 8th of April 2010

LOL - that was a brain fart release. Excuse that silliness.

Fantastic work!

Wouldn’t using the @rel attribute work better for links? that way you can reserve the title to something meaningful.

Wouldn’t using the @rel attribute work better for links?

Perhaps, but Markdown doesn’t support outputting @rel, so you’d be defeating the purpose. I do wonder if there’s a way you could adapt this syntax to apply it to any element.

::class:some-class I am a paragraph with class="some-class"

* ::class:first-item I am a list item with class="first-item"
* ::rel:white-trash I have no class

Whaddya reckon?

Possibly, but then the Markdown is becoming hideously unreadable. As much I do like what you’re proposing :)

Possibly, but then the Markdown is becoming hideously unreadable.

Heh, this is true. I’m really just looking for something that would make it easier for clients to specify various options while not having to learn HTML. Perhaps a utility that implements something akin to WordPress’ (shudders) short tags might be useful in this situation.

@Tony - This is working great on my end (thanks!), but while implementing I noticed that the description above the extension shows that the attributes should be defined as:

class:some-class;;alt:Some great text;;align:left

The actual code has a space in the split though, so it needs to be:

class:some-class;; alt:Some great text;; align:left

You might want to change either the description or the split so that they’re consistent (just to reduce confusion).

It might also help to specify in the description (in case it isn’t immediately obvious) that to create a title (or alt) attribute along with other attributes you just add it in manually:

class:my-class;; title:This is my awesome title

Just as a note to anyone else playing around with this, you don’t actually have to re-specify the title or alt tags, as it will use the default node name if can’t find the : character for attribute/value pairing.

So you can also specify a title and class with:

 This is my awesome title;; class:my-class  

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details