Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 15:33
    Phil Crowe
    0

    Member properties not displaying in xslt

    I developed an importer to move members from one site (none umbraco) to a new one. I had an xslt file that was displaying information correctly until after imported all the new members. now i cant get the member properties to display correctly:

     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
    
    
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    
      <xsl:template match="/">
    
        <xsl:choose>
          <xsl:when test="umbraco.library:RequestQueryString('memberId')">
            <xsl:variable name="mxml" select="umbraco.library:GetMember(umbraco.library:RequestQueryString('memberId'))" />
    
            <xsl:call-template name="details">
              <xsl:with-param name="mxml" select="$mxml" />
            </xsl:call-template>
          </xsl:when>
    
          <xsl:otherwise>
            <xsl:variable name="mxml" select="umbraco.library:GetCurrentMember()" />
    
            <xsl:call-template name="details">
              <xsl:with-param name="mxml" select="$mxml" />
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
    
    
    </xsl:template>
    
    
      <xsl:template name="details">
        <xsl:param name="mxml" />
    
        <h2>
          <xsl:value-of select="$mxml"/></h2>
        <div class="usercolltop">
          <div>
            <div style ="float:left; width:120px;height:120px;margin-right:10px;" >
              <img  src="{$mxml/profilePicture}" onerror="ImgError(this);" width="120" height="120" />
            </div>
            <br/>
          </div>
    
          <div>
    
            <h3>
              Name: <xsl:value-of select="$mxml/firstName"/>&nbsp;<xsl:value-of select="$mxml/lastName"/>
            </h3>
            <h3>
              Email: <xsl:value-of select="$mxml/myEmail"/>
            </h3>
            <h3>
              Address: <xsl:value-of select="$mxml/address"/>
            </h3>
            <input type="button" id="btnEditMyProfile" value="Edit My Profile" />
          </div>
        </div>
        <br/>
    
      </xsl:template>  
    
    
    </xsl:stylesheet>

    this line:    <h2>

    <xsl:value-of select="$mxml"/></h2>

    is displaying the member and all the properties as you would expect. but then these lines:


     

              Name: <xsl:value-of select="$mxml/firstName"/>&nbsp;<xsl:value-of select="$mxml/lastName"/>
            </h3>
            <h3>
              Email: <xsl:value-of select="$mxml/myEmail"/>
            </h3>
            <h3>
              Address: <xsl:value-of select="$mxml/address"/>

    are displaying absolutely nothing... 

  • Chris Koiak 700 posts 2626 karma points
    Dec 09, 2010 @ 16:08
    Chris Koiak
    0

    Use

    <textarea>
    <xsl:copy-of select="$mxml"/>
    </textarea>

    to check what the returned XML actualy contains.

  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 16:23
    Phil Crowe
    0

    wow nice trick! well it shows me the right values are there under the correctly named properties. ive noticed if im logged in (so member is being called by GetCurrnetMember instead of the querystring. everything is showing correctly. so the problem lies where im trying to called a member thats being called from the querystring. I just cant see it! your code shows me everything is being called just the <value of selects... arent showing it.

  • Chris Koiak 700 posts 2626 karma points
    Dec 09, 2010 @ 16:40
    Chris Koiak
    0

    Can you post what the <xsl:copy-of select="$mxml"/> is outputting for the querystring scenario?

  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 16:46
    Phil Crowe
    0

     

     

    <I removed this post for security reason>

     

     

  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 16:48
    Phil Crowe
    0

    first one is for querystring second one is for currentmember

  • Chris Koiak 700 posts 2626 karma points
    Dec 09, 2010 @ 16:57
    Chris Koiak
    0

    Looks fine, I'm stabbing in the dark here, but try removing the creation of the variables so change the top line to

     <xsl:when test="umbraco.library:RequestQueryString('memberId')">
            <xsl:call-template name="details">
             
    <xsl:with-param name="mxml" select="umbraco.library:GetMember(umbraco.library:RequestQueryString('memberId'))" />
           
    </xsl:call-template>
         
    </xsl:when>
  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 17:13
    Phil Crowe
    0

    nope still nothing... im convinced theres an umbraco bug here.

  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 17:16
  • Chris Koiak 700 posts 2626 karma points
    Dec 09, 2010 @ 18:38
    Chris Koiak
    0

    try changing

    <xsl:value-of select="$mxml/firstName"/>

    to

     

    <xsl:value-of select="$mxml/*/firstName"/>

     

  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 18:52
    Phil Crowe
    0

    well that solves the issue querystring issue, but breaks if you requesting the current member. but i can just change the xslt to suit :-D thanks chris!

Please Sign in or register to post replies

Write your reply to:

Draft