Garmaine Staff asked 2 years ago

I got the next code in XML

    <body>Descripción del producto</body>

I need to convert this XML in this HTML:

<!-- Central section -->
<div class="title">
<section class="central-margin">
    <div class="container central-content">

        <!-- Carousel images -->
        <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
            <div class="carousel-inner">
                <div class="carousel-item active">
                    <img class="d-block w-100" src="image-1" alt="First slide">
                <div class="carousel-item">
                    <img class="d-block w-100" src="image-2" alt="First slide">
                <div class="carousel-item">
                    <img class="d-block w-100" src="image-3" alt="First slide">

        <!-- Product info -->
        <div class="product-content">
            <div class="description">
        <div class="data">
            <form action="">
                <label>Precio:<span class="float-right">300 €</span></label><br>
                <label>Stock:<span class="float-right">0</span></label><br>
                <input type="text" name="id" value="6" hidden>
                <input type="submit" class="btn btn-primary w-100" value="Comprar">

I try to do it with multiples XSL files. I dont understand how to create this two parts (the div for title, section for content) with only one XSL File. My second problem is that I dont know exactly how "xsl:for-each" and "xsl:template match=''" works. If someone can help me with a simple example with be nice.

Sorry if i wrote something wrong, im from spain and I dont know much english.

Thanx for the help.