-1

I am not particularly happy with the html5 standard for document markups. It seems more suited to websites, and cannot figure out what is a higher-level and lower-level semantic markup.

I am not particularly happy with latex. it does not have a sane syntax.

I am not particularly happy with xhtml. if <span> and <div> are so common, could they not have used <s> and <d> as common abbreviations, instead?

I wonder---is it possible to define my own xml language that every modern browser can render (e.g., if the document refers to xslt transformation rules, or something like it)? I would not want to start from scratch, but with a template, e.g., to define a subset of html4. I would want to define latex-like macro = tags (e.g., \section <-> <section>). it would not have certain latex features, like newcommand or def or ... . does such a latex-markup xml language already exist, with support tools?

this could then be easily rendered into either a browser-native html, or easily into a latex file---and it would cure a lot of the shortcomings above.

Mathias Müller
  • 22,203
  • 13
  • 58
  • 75
ivo Welch
  • 2,427
  • 2
  • 23
  • 31

1 Answers1

1

-is it possible to define my own xml language that every modern browser can render

The X in XML stands for "eXtensible" - so yes, you can define your own variant (or perhaps find an existing one that could suit you).

If you then construct a stylesheet to transform your grammar into HTML, and include a reference to the stylesheet in your document, then any browser will be able to display it.


EDIT:

Here's a very simple (and not strictly correct) example.

Save this as "content.xml":

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="xslt.xsl"?>
<private>
    <eltit>My Title</eltit>
    <ydob>
        <crown>Lorem Ipsum</crown>
        <arap>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam interdum ante quis erat pellentesque elementum.</arap>
        <arap>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut molestie quam sit amet ligula.</arap>
        <arap>In enim. Duis dapibus hendrerit quam. Donec hendrerit lectus vel nunc.</arap>
        <crown>Vivamus Adipiscing</crown>
        <arap>Vivamus adipiscing, turpis ac consectetuer rhoncus, tortor lorem hendrerit nisi, ac tempus sem mauris in tortor.</arap>
        <arap>Nulla elit est, rutrum at, semper id, mollis sed, tortor.</arap>
    </ydob>
</private>

Save this as "xslt.xsl":

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" indent="yes"/>

<xsl:template match="/private">
<html>
    <xsl:apply-templates/>
</html>
</xsl:template>

<xsl:template match="eltit">
<title>
    <xsl:apply-templates/>
</title>
</xsl:template>

<xsl:template match="ydob">
<body>
    <xsl:apply-templates/>
</body>
</xsl:template>

<xsl:template match="crown">
<h2>
    <xsl:apply-templates/>
</h2>
</xsl:template>

<xsl:template match="arap">
<p>
    <xsl:apply-templates/>
</p>
</xsl:template>

</xsl:stylesheet> 

Load "content.xml" in a browser (make sure "xslt.xsl" is in the same directory).

michael.hor257k
  • 113,275
  • 6
  • 33
  • 51
  • yes, but can chrome/firefox/IE then display it the way I want? and is there a starting sample? – ivo Welch Jan 30 '14 at 20:32
  • @ivoWelch I have added an example to my answer above. – michael.hor257k Jan 30 '14 at 21:15
  • thx, but it does not display anything on chrome/linux, even though I double checked spelling. does it work on your's? – ivo Welch Jan 31 '14 at 00:26
  • @ivoWelch So you googled `XSLT Chrome` and found this as the #1 ranked link, right? http://stackoverflow.com/questions/2981524 – michael.hor257k Jan 31 '14 at 02:40
  • nope. I assumed that, given that either the code was wrong or chrome was wrong, the former was so much more likely that I did not have to do it. alas, I was wrong and chrome was wrong. thanks. pretty cool stuff. – ivo Welch Jan 31 '14 at 03:12