xsl-list
[Top] [All Lists]

[xsl] question on paths

2010-05-26 17:54:47
Ok will try again. Appreciate all your responses before.

I am writing this function:
---------------
<xsl:function name="fnc:getPatientRolePath">
    <xsl:param name="Version"/>
    <xsl:choose>
        <xsl:when test="$Version = '3.0'">
            <xsl: select="/n1:Document/n1:recordTarget/n1:patientRole"/>
        </xsl:when>
        <xsl:otherwise>UNDEFINED</xsl:otherwise>
    </xsl:choose>
</xsl:function>
---------------
I am writing this function so as to create a variable patientRolePath
to hold the value: /n1:Document/n1:recordTarget/n1:patientRole.
This is because then I can use the variable name patientRolePath and
append child nodes and get required values such as:

$patientRolePath/id
$patientRolePath/lastName
$patientRolePath/firstName

However this that function I can't seem to write it to return with the path.
<xsl: select="/n1:Document/n1:recordTarget/n1:patientRole"/> is not valid
HOWEVER
<xsl:variable name="patientRole"
select="/n1:Document/n1:recordTarget/n1:patientRole"/>
written as a statement is valid. But does not return me anything.
OR
<xsl:value-of select="/n1:Document/n1:recordTarget/n1:patientRole"/>
is valid, but don't need the value of - just need the path.
---------------
Hope that explains it better?
I have written a few other functions so seem to be able to write functions.
Maybe it needs to be done with a node test?
Also just bought Michael Kay's book so looking forward to it as soon
as it reaches here from Amazon.

Also does XSLT have 'out' parameters? Or functions only way to achieve this?
---------------
Thanks again.

monosij

--~------------------------------------------------------------------
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>