xsl-list
[Top] [All Lists]

Re: building path expressions around dynamic element node names

2005-05-18 05:43:52


Hi,
    Can you read my mail again.

In your code,
 ../parent::node(.) should be name(../parent::node()) though Iam not
comfortable with the construct ../parent::node() yet. But I suppose you
don't have a choice as you may not know the name of the node beforehand in
which case you don't need this test in the first place.

or use DC's suggestion

<xsl:if test="../parent::node() = self::Dynamic1">
....

Note that I have not used single quotes around Dynamic1 as I did earlier as
this is a node comparison as opposed to the string comparison I did
earlier.

Cheers,
Omprakash.V







                                                                                
                                     
                    Rahil                                                       
                                     
                    <qamar_rahil(_at_)ya        To:     
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com                                
   
                    hoo.co.uk>             cc:     (bcc: omprakash.v/Polaris)   
                                     
                                           Subject:     Re: [xsl] building path 
expressions around dynamic element   
                    05/18/2005             node    names                        
                                     
                    05:59 PM                                                    
                                     
                    Please respond                                              
                                     
                    to xsl-list                                                 
                                     
                                                                                
                                     
                                                                                
                                     




Sorry still some problems.

David Carlisle wrote:

Also, I wanted to know how to access <Dynamic1> when the control is
inside B/Class



lots of ways:

ancestor::Dynamic1
or
../parent::Dynamic1



So I tried Omprakash and your solution to checking a node name as well
as accessing the node from a grand-child into one but there are problems
with my syntax. Here is what I tried

<xsl:if
test="../parent::node(.)=..//preceding-sibling::A/Class/text()"><!
--Checking 
if the ancestor node equals the A/Class text. -->
         <here>nfhg</here>
</xsl:if>

Tried this as well
<xsl:variable name="AValue" select="..//preceding-sibling::A/Class/text
()"/>
<xsl:if test="../parent::node(.)=$AValue"><!--Checking if the ancestor
node equals the A/Class text. -->
         <here>nfhg</here>
</xsl:if>

Am I at a  tangent from the right solution and what is it ?

Thanks
Rahil

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






This e-Mail may contain proprietary and confidential information and is sent 
for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to 
you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its 
attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

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