XSL FO inline alignment on an existing sort/conditional XSL
I need to get right-align and left-align working in the same line. Looking over similar responses, I found the below recommendation, 

    <fo:block text-align-last="justify">
      LEFT TEXT (want this to be the Contacts element from the below)
      <fo:leader leader-pattern="space" />
      RIGHT TEXT (want this to be the Address1 element from the below)
    </fo:block>


But when I try to apply it to my existing XSL code (see below) I can’t make it work – I don’t know enough about how to edit it to accommodate/merge both the sort/conditionals and the FO.  Can someone help me get this right? 

Exsiting/working code:

    <?xml version="1.0"?><!-- DWXMLSource="XML - Builder Members.xml" -->
    <!DOCTYPE xsl:stylesheet  [<!ENTITY nbsp   "&#160;">]>

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="no"/>

    <xsl:template match="/">
    <memberdata>  
    <xsl:for-each select="memberdata/memberinfo">
    <xsl:sort select="SortKey"/>

    <memberdata>

    <xsl:if test="Contacts[.!='']">
    <Contacts><xsl:value-of select="Contacts" /></Contacts><xsl:text>
    </xsl:text>
    </xsl:if>

    <xsl:if test="Address1[.!='']">
    <Address1><xsl:value-of select="Address1" /></Address1><xsl:text>
    </xsl:text>
    </xsl:if>

    </memberdata>
    </xsl:for-each>

    </memberdata> 
   
    </xsl:template>
    </xsl:stylesheet>

XSL FO inline alignment on an existing sort/conditional XSL
===

I need to get right-align and left-align working in the same line. Looking over similar responses, I found the below recommendation, 

    <fo:block text-align-last="justify">
      LEFT TEXT (want this to be the Contacts element from the below)
      <fo:leader leader-pattern="space" />
      RIGHT TEXT (want this to be the Address1 element from the below)
    </fo:block>


But when I try to apply it to my existing XSL code (see below) I can’t make it work – I don’t know enough about how to edit it to accommodate/merge both the sort/conditionals and the FO.  Can someone help me get this right? 

Exsiting/working code:

    <?xml version="1.0"?><!-- DWXMLSource="XML - Builder Members.xml" -->
    <!DOCTYPE xsl:stylesheet  [<!ENTITY nbsp   "&#160;">]>

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="no"/>

    <xsl:template match="/">
    <memberdata>  
    <xsl:for-each select="memberdata/memberinfo">
    <xsl:sort select="SortKey"/>

    <memberdata>

    <xsl:if test="Contacts[.!='']">
    <Contacts><xsl:value-of select="Contacts" /></Contacts><xsl:text>
    </xsl:text>
    </xsl:if>

    <xsl:if test="Address1[.!='']">
    <Address1><xsl:value-of select="Address1" /></Address1><xsl:text>
    </xsl:text>
    </xsl:if>

    </memberdata>
    </xsl:for-each>

    </memberdata> 
   
    </xsl:template>
    </xsl:stylesheet>
