test existence of a similar node with same key name

Discussion in 'XML' started by bjam, Jun 9, 2005.

  1. bjam

    bjam Guest

    Hi, basically I am trying to create the following logic in an xsl style
    sheet, which is:

    if a similar node with the same key name exists in the another section
    of the file, I will use that data item to create a link attribute.
    Below will help explain. Basically if a <links> tag has an item in it
    with the same key="X" then I want to create a link out of it.
    Therefore, if I have the following xml snippet


    <item key="non_viewable">
    <item key="links">
    <hashref memory_address="0x8cc8f50">
    <item
    key="a_field">../files/attachment.mail.26897.20050608.__DQM_TEST__.text_1</item>
    </hashref>
    </item>
    </item>

    <item key="viewable">
    <hashref memory_address="0x8cc33dc">
    <item key="a_field">attachment.mail.*.20050608.*.text_1</item>
    </hashref>
    </item>


    since there is an item with a key="a_field" in the links section I want
    the xsl style sheet code to output html to be

    <a href="../files/attachment.mail.26897.20050608.__DQM_TEST__.text_1" >
    attachment.mail.*.20050608.*.text_1 </a>

    Any help is greatly appreciated on how to write the XPATH and xsl test
    statement for this. If the link was not there it would just remove the
    <a> tags and just use say <p>
     
    bjam, Jun 9, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,470
  2. Tjerk Wolterink
    Replies:
    2
    Views:
    1,440
    Dimitre Novatchev
    Aug 24, 2006
  3. jiing
    Replies:
    0
    Views:
    2,336
    jiing
    Apr 27, 2007
  4. rodrigo
    Replies:
    9
    Views:
    436
    Bruno Desthuilliers
    Aug 29, 2007
  5. DL
    Replies:
    0
    Views:
    94
Loading...

Share This Page