XSL with Facebook XML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • reblace
    New Member
    • Nov 2008
    • 2

    XSL with Facebook XML

    I'm trying to translate the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <users_getInfo_ response xmlns="http://api.facebook.co m/1.0/" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocat ion="http://api.facebook.co m/1.0/ http://api.facebook.co m/1.0/facebook.xsd" list="true">
    <user>
    <uid>0000</uid>
    </user>
    </users_getInfo_r esponse>

    using this XSL:

    <?xml version="1.0"?>
    <xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
    version="2.0">
    <xsl:output method="html" encoding="UTF-8"
    indent="yes" />
    <xsl:template match="/">
    <html>
    <body>
    <xsl:apply-templates />
    </body>
    </html>
    </xsl:template>

    <xsl:template match="user">
    <h1><xsl:valu e-of select="uid"/></h1>
    </xsl:template>
    </xsl:stylesheet>

    and I get the following as the output:

    <html>
    <body>

    0000

    </body>
    </html>

    Any idea why this XSL doesn't work? The only way I can get it do work correctly is to remove the attributes from the users_getInfo_r esponse element.

    -Ryan
  • reblace
    New Member
    • Nov 2008
    • 2

    #2
    Actually figured it out. I had to add the facebook namespace (which was identified as the xmlns="") to the XSL. I hadn't noticed it since it was just the base namespace.

    Comment

    Working...