XSL vs XSLT

A newbie here :o)

What is the differnece between XSL and XSLT - I know that XSLT is a subset language of XSL but am otherwise confused...

What would the following be:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

    <xsl:template match="bookstore">
    <!-- Prices and books -->
        <bookstore>
            <xsl:apply-templates select="book"/>
        </bookstore>
    </xsl:template>

    <xsl:template match="book">
        <book>
            <xsl:attribute name="ISBN">
                <xsl:value-of select="@ISBN"/>
            </xsl:attribute>
            <price><xsl:value-of select="price"/></price><xsl:text>
            </xsl:text>
        </book>
    </xsl:template>

</xsl:stylesheet>

It is labeled : Using XSLT and .NET to Manipulate XML Files  but then al elements are xsl:

Thanks for helping clear the confusion!
LVL 35
mrichmonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

J_MakCommented:
XSL is bascically made up of two major components: XSLT (Extensible Stylesheet Language Transformations) and XSL-FO (Extensible Stylesheet Language Formatting Objects). Most of the time, everyone uses the more basic XSLT. But when everyone refers to 'XSL', usually they are just generally referring to the stylesheet. That is, generally, if I say, "this is my XSL", it's just like saying, "this is my stylesheet". It really depends on the context of what you are talking about.

Your above example would be best referred to as a 'stylesheet'. A stylesheet uses the XSLT part of XSL to create rules that govern the way an XML file will be transformed. The 'xsl:' prefix  basically refers to the URI namespace which is http://www.w3.org/1999/XSL/Transform, and this is declared at the top. When you write xsl:template, the 'template' belongs to the 'xsl' namespace that you declared. You didn't have to use 'xsl'. You could say something like:

<hello:stylesheet version="1.0" xmlns:hello="http://www.w3.org/1999/XSL/Transform">

then the stylesheet would look like:

<hello:stylesheet version="1.0" xmlns:hello="http://www.w3.org/1999/XSL/Transform">

    <hello:template match="/">
    <root>
        <hello:apply-templates/>
    </root>
    </hello:template>

    <hello:template match="bookstore">
    <!-- Prices and books -->
        <bookstore>
            <hello:apply-templates select="book"/>
        </bookstore>
    </hello:template>

    <hello:template match="book">
        <book>
            <hello:attribute name="ISBN">
                <hello:value-of select="@ISBN"/>
            </hellol:attribute>
            <price><hello:value-of select="price"/></price><hello:text>
            </hello:text>
        </book>
    </hello:template>

</hello:stylesheet>

'hello' or 'xsl' is just a meand of defining a prefix to refer to the URI http://www.w3.org/1999/XSL/Transform. I hope that clears it up. Cheers.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrichmonAuthor Commented:
okay that does help a lot.

One more question then.

In general would you use an extention of .xsl or .xslt for a a file that turns xml into xhtml display?
0
J_MakCommented:
You should use .xsl

That is the standard extension for a stylesheet that converts an XML into any format that you want.

Cheers.
0
dualsoulCommented:
i preffer to use XSLT for stylesheet, and .fo for FO documents.

the one problem with XSLT - is there are no standard mime-mapping for this filetypes in major web servers like Apache and IIS, so some browsers like Mozilla wouldn't interpret this file in a right way. But, probably you would never faced this case :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.