xsl-list
[Top] [All Lists]

[xsl] doc-available vs. exists(document)

2009-06-15 18:16:26
In the template below, I'm getting different results depending on which "when" 
test I use.

If I use the exists(document($name)) test, it passes; but doc-available($name) 
fails.

The input document is schema valid.

The template is invoked with something like:
<my-doc href="Initialization\Begin.xml"/>

I thought I was using doc-available correctly, and it has worked fine in other 
situations.  I'd like to use doc-available to avoid the java error message 
about a file not found, and process the error condition myself.

What am I overlooking?

Thanks, Mike


    <xsl:template match="my-doc">
        <xsl:variable name="name" select="@href"/>
        <xsl:choose>
            <xsl:when test="exists(document($name))">
            <!-- <xsl:when test="doc-available($name)"> -->
                <xsl:message>document is available</xsl:message>  
                <xsl:apply-templates select="document($name)/*"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:message>document error</xsl:message>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>


This email and any attachments are only for use by the intended recipient(s) 
and may contain legally privileged, confidential, proprietary or otherwise 
private information.  Any unauthorized use, reproduction, dissemination, 
distribution or other disclosure of the contents of this e-mail or its 
attachments is strictly prohibited.  If you have received this email in error, 
please notify the sender immediately and delete the original.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>