www.webdeveloper.com
Results 1 to 5 of 5

Thread: path

  1. #1
    Join Date
    Jul 2003
    Posts
    10

    Question path

    i have a big problem: it is when i have a path (chemin) data in xml document such as pictures wich is in the hard disk, i can't reload the view (aperçu) with a xslt page it can't be reloaded?

  2. #2
    Join Date
    Aug 2003
    Location
    London, United Kingdom
    Posts
    117
    Hi,

    Yes it can be done with XSLT, though you did not specify how you're trying to accomplish this. The easiest way is to use xsl:element to create an HTML img tag then display images from your hard disk.

    The xml file (I called it gallery.xml)

    <?xml version="1.0"?>
    <?xml:stylesheet type="text/xsl" href="gallery.xsl"?>
    <gallery>
    <topic>Image Gallery</topic>
    <picture>
    <description>Description for Image 1.</description>
    <image>1.gif</image>
    </picture>
    <picture>
    <description>Description for Image 2.</description>
    <image>2.gif</image>
    </picture>
    </gallery>

    The xsl file (I called it gallery.xsl)

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xslutput method="html" />
    <xsl:template match="/">
    <html>
    <head>
    <title>My Image Gallery</title>
    </head>
    <body>
    <h3>
    <xsl:value-of select="gallery/topic"/>
    </h3>
    <xsl:for-each select="gallery/picture">

    <xsl:value-of select="description"/>
    <br />
    <xsl:element name="img">
    <xsl:attribute name="src">
    <xsl:value-of select="image"/>
    </xsl:attribute>
    </xsl:element>
    <br />
    </xsl:for-each>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    You end up being who you are.
    http://www.geocities.com/lillamarta

  3. #3
    Join Date
    Apr 2003
    Posts
    51
    I can't seem to get this code to run under Opera 7.11 or Netscape 7.1 in fact I can only view it correctly in IE 6.0

  4. #4
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,119
    I could be wrong,but I dont think Opera has a built in processor for XML file rendering,It should have worked for NS though.
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  5. #5
    Join Date
    Aug 2003
    Location
    London, United Kingdom
    Posts
    117
    Opera 7 can parse and display XML documents.

    Opera does not support XSL formatting objects or
    XSLT transformations.

    Netscape 7 supports XML. Not sure about xslt.

    Try to get an xslt parser to work with your browsers.
    You end up being who you are.
    http://www.geocities.com/lillamarta

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles