473,410 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

test existence of a similar node with same key name

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>

Jul 20 '05 #1
0 1045

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Thierry S. | last post by:
Hello. I would to test the existence of a variable before to use it (like isset($myVar) in PHP). I try using "if myVar: ", but there is the error meesage (naturally): "NameError: name 'myVar'...
1
by: Porthos | last post by:
Are there 'Null' and 'not equal to' operator that I can use in xsl:if statements? I assume that there must be, but I can't figure out the syntax. For example: <xsl:if test="@title DOES NOT...
4
by: n_o_s_p_a__m | last post by:
My xml doc has many <title></title> and <title> in it, meaning the nodes have no content (although some do). How can I test for this? I tried title (doesn't work) I tried //title (doesn't work)...
7
by: Pietro | last post by:
Hi at all, I am looking for a mean to test if a function work with a certain Browser or not. I'ld like to make a funcrion that return true if the browse is compatible with a certain funcrion or...
25
by: Treetop | last post by:
I have seen some codes that can test for the browser and give values accordingly. I tried to read the FAQ, but was unable to find a simple version of this. What I want is If Netscape-test {...
5
by: Richard L Rosenheim | last post by:
What's the proper technique for checking for the existence of an attribute within a node? Lets say I did a SelectSingleNode which returned this element: <AnAddress city="San Francisco"...
6
by: Vmusic | last post by:
Hi, I am using Javascript to add rows to tables, etc. in a function I am calling. I pass the function the ID of the div, and what I want in the rows, and it will add rows to a table in the div. ...
1
by: chittasuman | last post by:
QUESTION: There is a xml node like <icc> <cricket> <player>sachin</player> <score>15</score> </cricket> <cricket> <player>dravid</player>
3
by: gentsquash | last post by:
Inside of <script></script>, inside of <body></body>, what are the differences between document.body.className="mystyle"; and document.body.setAttribute("class", "mystyle"); ? (...assuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.