SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Viewing .xsl files as html

    Hi all

    I've just started working with xslt and everything seems ok when I create xsl files in work using dreamweaver then press f12 to view the rendered html output, but now that I'm at home on my mac without dreamweaver using netbeans I have no idea how to view/preview my xsl files as html?

    Do i need to download some software or is this a simply solution?

    Many thanks, Barry
    The more you learn.... the more you learn there is more to learn.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,195
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    What's the file extension of those files? If .html, then just open them in your browser. (I'm not familiar with .xsl, so forgive me if that's a dumb question, but web pages are best tested in a browser.)

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks Ralph, the files are .xsl basically a stylesheet for xml output.
    As I mention above, if I'm in DW and preview the below it converts to html very easy just wondering what I need to do so I can view in the browser on mac?

    Code HTML4Strict:
    <?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="listing.xml" -->
     
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" encoding="utf-8"/>
    <xsl:template match="/">
     
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>default</title>
    </head>
     
    <body>
     
    <div class="wrapper">

    Thnaks
    The more you learn.... the more you learn there is more to learn.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,195
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    If you rename the file to .html you can then open it in your browser.

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes Ralph but nothing is rendered I've already tried this, thanks
    The more you learn.... the more you learn there is more to learn.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,195
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Is there any content in the file, though? There isn't any in what you posted above, though I realize it's incomplete.

  7. #7
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was just a small snippet Ralph to show you,
    here is the full file I'm trying to view which is styling listing.xml

    Code HTML4Strict:
    <?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="listing.xml" -->
    <!DOCTYPE xsl:stylesheet  [
    	<!ENTITY nbsp   " ">
    	<!ENTITY copy   "©">
    	<!ENTITY reg    "®">
    	<!ENTITY trade  "™">
    	<!ENTITY mdash  "—">
    	<!ENTITY ldquo  "“">
    	<!ENTITY rdquo  "”"> 
    	<!ENTITY pound  "£">
    	<!ENTITY yen    "¥">
    	<!ENTITY euro   "€">
    ]>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" encoding="utf-8"/>
    <xsl:template match="/">
     
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>default</title>
    </head>
     
    <body>
     
    <div class="wrapper">
     
        <ul>
        <xsl:for-each select="tshirts/tshirt">
        <xsl:sort select="color"/>
     
        <xsl:if test="cost &gt; 10">
     
        	<li>
            <xsl:value-of select="name"/>
            <br />
            <xsl:value-of select="cost"/>
            <br />
            <select>
            <xsl:for-each select="colors/color">
                <option>
                <xsl:value-of select="."/>
                </option>
            </xsl:for-each>
            </select>
            </li>
     
        </xsl:if>
        </xsl:for-each>
        </ul>
     
    </div>
     
     
    </body>
    </html>
     
    </xsl:template>
    </xsl:stylesheet>

    Cheers
    The more you learn.... the more you learn there is more to learn.

  8. #8
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found a free XSLT engine which does what I need with some good examples.
    If you haven't got DW, and like me, need something to process your XSLT I suggest Marc Liyanage - Software - Mac OS X Packages

    Barry
    The more you learn.... the more you learn there is more to learn.


Bookmarks

Posting Permissions

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