Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Testing for file present in XML?

  1. #1
    jay01 is offline Junior Member
    Join Date
    Oct 2009
    Posts
    15

    Default Testing for file present in XML?

    We have product manuals available for most of our products so I am trying to check if the file is present in product.SimpleVariant.xml.config and display a link if it is.
    I am using:

    <xsl:if test="aspdnsf:FileExists(concat('../images/manuals/', SKU, '.pdf') = 'true'" >
    <a href="{concat('../images/manuals/', SKU, '.pdf')}">Manual Available</a>
    </xsl:if>

    That is giving me an error. What is wrong with the statement? Is FileExists available for use in XML?

    Thanks,
    Jason

  2. #2
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Just looking at it quickly...

    - Add a )
    - and the ='true' isn't necessary

    So, this should work:

    Code:
    <xsl:if test="aspdnsf:FileExists(concat('../images/manuals/', SKU, '.pdf')) " >
    <a href="{concat('../images/manuals/', SKU, '.pdf')}">Manual Available</a>
    </xsl:if>

  3. #3
    jay01 is offline Junior Member
    Join Date
    Oct 2009
    Posts
    15

    Default

    Thank you for catching that! I looked at that thing for 10 minutes and never saw the missing )