views:

74

answers:

2

Does anyone have an XML style sheet that'll convert wiki-like markup to HTML? Or is that a bad idea? I only found one style sheet that'll convert HTML to wiki-like markup, view-source:http://mozile.mozdev.org/0.8/demos/html2wiki.xsl . Or is this a bad idea? Basically, instead of following strict rules with my XML tags to format my content, I thought it'd be best to have something like this:

<content> \## This is my heading </content>

That way I'm free to display my content however I feel without having to modify my style sheet.

Any ideas?

A: 

With sensibly crafted XML and a proper stylesheet you would rarely or never have to modify your XSLT code.

However, XSLT is not for string processing. You should not try to work on stuff like this:

<content> \## This is my heading </content>

but rather like this:

<content><heading>This is my heading</heading></content>

To get from Wiki style text ## This is my heading to proper XML you would have to use something other than XSL first (i.e. a parser that understands the Wiki markup). Once you have proper XML, you can go on with XSLT.

Tomalak
A: 

Thanks for the reply, Tomalak.

I'm currently using something like you suggested, however, it seems I'm going to have a lot of display cases. Meaning that my XSL will have to account for a wide variety of content styles. It seems that if I were to go the XSL route to format my content, I'd be left with a big CF of template trying to account for every possibility. I mean, I could want my content to be formated in the following ways, but not limited to:

Heading
    - Link #1
    - Link #2
        - Sub Link #1

Heading
    - Link #1 (link description), Link #11 <image> (link description)
    - Link #2
        - Sub Link #1

And so on...

Mike
John Saunders