xml agregar imagen

<?xml version="1.0" encoding="iso-8859-15"?>
<?xml-stylesheet type="text/xsl" href="ejemplo9.xsl"?>

<agenda_tebeo>
<personaje numero="1">
  <dibujo ruta="objetos/mortadelo.gif"/>
  <nombre>Mortadelo</nombre>
  <telefono>666555444</telefono>
  <email>[email protected]</email>
  <web enlace="http://www.mortadeloyfilemon.com/index2.asp">
    web oficial</web>
</personaje>

<personaje numero="2">
  <dibujo ruta="objetos/filemon.gif"/>
  <nombre>Filemon Pi</nombre>
  <telefono>665544332</telefono>
  <email>[email protected]</email>
  <web enlace="http://www.mortadeloyfilemon.com/personajes/protas.asp">
    Los personajes</web>
</personaje>

<personaje numero="3">
  <dibujo ruta="objetos/super_vicente.gif"/>
  <nombre>Superintendente Vicente</nombre>
  <telefono>678901234</telefono>
  <email>[email protected]</email>
  <web enlace="http://www.mortadeloyfilemon.com/juegos/index.asp">
    Juegos</web>
</personaje>

</agenda_tebeo>

3
1
Saradela 85 points

                                    &lt;xsl:element name=&quot;img&quot;&gt;
   &lt;xsl:attribute name=&quot;src&quot;&gt;
      &lt;xsl:value-of select=&quot;dibujo/@ruta&quot;/&gt;
   &lt;/xsl:attribute&gt;
   &lt;xsl:attribute name=&quot;height&quot;&gt;
      100
   &lt;/xsl:attribute&gt;
&lt;/xsl:element&gt;

3 (1 Votes)
0
4.6
5

                                    &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;
&lt;xsl:template match=&quot;agenda_tebeo&quot;&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Agenda tebeo&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Agenda de tebeo&lt;/h1&gt;

&lt;xsl:for-each select=&quot;personaje&quot;&gt;
&lt;div class=&quot;personaje&quot; style=&quot;float: left; width: 300px;&quot;  &gt;
  &lt;h3&gt;Personaje n&uacute;mero: &lt;xsl:value-of select=&quot;@numero&quot;/&gt;&lt;/h3&gt;
  &lt;div style=&quot;width: 70px; float: left;&quot;&gt;
     &lt;xsl:element name=&quot;img&quot;&gt;
       &lt;xsl:attribute name=&quot;src&quot;&gt;
         &lt;xsl:value-of select=&quot;dibujo/@ruta&quot;/&gt;
       &lt;/xsl:attribute&gt;
       &lt;xsl:attribute name=&quot;height&quot;&gt;
         100
       &lt;/xsl:attribute&gt;
     &lt;/xsl:element&gt;
&lt;/div&gt;
  &lt;ul  style=&quot;float: left;&quot;&gt;
    &lt;li&gt;&lt;xsl:value-of select=&quot;nombre&quot;/&gt;&lt;/li&gt;
    &lt;li&gt;&lt;xsl:value-of select=&quot;telefono&quot;/&gt;&lt;/li&gt;
    &lt;li&gt;&lt;xsl:value-of select=&quot;email&quot;/&gt;&lt;/li&gt;
    &lt;li&gt;
      &lt;a&gt;
        &lt;xsl:attribute name=&quot;href&quot;&gt;
          &lt;xsl:value-of select=&quot;web/@enlace&quot;/&gt;
        &lt;/xsl:attribute&gt;
        &lt;xsl:value-of select=&quot;web&quot;/&gt;
      &lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;
&lt;/xsl:for-each&gt;

&lt;/body&gt;
&lt;/html&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

4.6 (5 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source