Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2006, 03:02 PM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help with XPATH Expression

 I have an XML file as follows...
<CCR>
 <Body>
   <Encounters>
    <Encounter>
      <Source>
       <Actor>
           <ActorID>AA0009</ActorID>
           </Actor>
      </Source>
    </Encounter>
  </Encounters>
 </Body>
 <Actors>
  <Actor>
     <ActorID>AA0009</ActorID>
     <Person>
     <Name>
         <DisplayName>AR</DisplayName>
         </Name>
     </Person>
  </Actor>
  <Actor>
     <ActorID>AA00010</ActorID>
     <Person>
     <Name>
         <DisplayName>ART</DisplayName>
         </Name>
     </Person>
  </Actor>
  <Actor>
     <ActorID>AA00011</ActorID>
     <Person>
     <Name>
         <DisplayName>ER</DisplayName>
         </Name>
     </Person>
  </Actor>
 </Actors>
</CCR>

Using XPATH, how do I retrieve the 'displayname'(AR) by referencing it using the 'ActorID' (AA0009).

When I use the expression /CCR/Actors/Actor[ActorObjectID = /CCR/Body/Encounters/Encounter/Source/Actor/ActorID ]/Person/Name/DisplayName , I get all of the 3 'displayname' . I just want the display name that has AA0009 as the 'actorid'. How do i do it? I am using Altova StyleVision.


 
Old May 12th, 2006, 04:41 AM
Authorized User
 
Join Date: Apr 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vakorde
Default

This XPath will solve your problem
/CCR/Actors/Actor[ActorID='AA0009']/Person/Name/DisplayName


---------------------------
Vikrant Korde
3i Infotech, Vashi,
Mumbai, Maharashtra, India.





Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath 2.0 every expression stolte XSLT 5 November 24th, 2008 03:32 PM
xpath-nested expression vinod.kumbar RSS and Atom 0 July 8th, 2008 11:36 AM
XPath Expression NEO1976 XSLT 11 August 2nd, 2006 02:28 AM
Need help with XPATH Expression benomathew XML 1 May 9th, 2006 03:38 PM
Logical XPath Expression rohit72 XML 0 June 23rd, 2004 11:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.