1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need some help with meta keywords tag in XSMT

Discussion in 'White Hat SEO' started by sinewave, Feb 3, 2008.

  1. sinewave

    sinewave Senior Member Premium Member

    Joined:
    Aug 25, 2007
    Messages:
    972
    Likes Received:
    503
    Hi everyone,
    Can anyone give me the dumbed-down version of how to generate a meta keywords tag from an XSLT file. I've been looking for almost 3 hours and am unable to understand what most of the online forums suggest.

    I just want to hard code it for the time being.

    HTML tags don't work on meta stuff generated from XSL.

    Thanks in advance.
    Best,
    Sine

    Edited because I can't seem to type. I meant "XSLT", not "XSMT"
     
  2. sinewave

    sinewave Senior Member Premium Member

    Joined:
    Aug 25, 2007
    Messages:
    972
    Likes Received:
    503
    Sorry for the bump, but no one has some advice with inserting metadata via an XSLT document?

    Best,
    Sine
     
  3. SmallStorm

    SmallStorm Junior Member

    Joined:
    Dec 4, 2007
    Messages:
    141
    Likes Received:
    64
    Hi Sinewave,

    I'm trying to understand what you are asking. Do you want to input into html page metatags generated from a xslt file? Spit out valid html from contents of a xslt doc.?

    Chris
     
  4. SmallStorm

    SmallStorm Junior Member

    Joined:
    Dec 4, 2007
    Messages:
    141
    Likes Received:
    64
    Sinewave,

    Does this page help any? hxxp://weblogs.asp.net/cnagel/archive/2004/09/24/233765.aspx

    Chris
     
  5. caretaker2007

    caretaker2007 Power Member

    Joined:
    Dec 20, 2007
    Messages:
    720
    Likes Received:
    454
    Occupation:
    To create income streams
    Location:
    In a 6 by 3 plot
    Home Page:
    Looking at the below from W3*Schools it seems like you can just add the head tag in with your meta. If someone sees that I am reading this wrong please tell me so I can not look silly in the future.

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">       <xsl:template match="/">
    <html>
    Add
    Code:
    <head>
    <meta stuff>
    </head>
    
    Then continue with the rest
    Code:
    <body>
    <h2>My CD Collection</h2> 
    <xsl:apply-templates/> 
    </body>
    </html>
    </xsl:template>       <xsl:template match="cd">
    <p>
    <xsl:apply-templates select="title"/> 
    <xsl:apply-templates select="artist"/>
    </p>
    </xsl:template>       <xsl:template match="title">
    Title: <span style="color:#ff0000">
    <xsl:value-of select="."/></span>
    <br />
    </xsl:template>       <xsl:template match="artist">
    Artist: <span style="color:#00ff00">
    <xsl:value-of select="."/></span>
    <br />
    </xsl:template>       </xsl:stylesheet>