473,406 Members | 2,352 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,406 software developers and data experts.

Xml Add attribute to link

63
Hi all

I got some problems with my xml/xsl.I'm working on asp.net(vb)

These are my xml files. __________________________________________________ ________________

<Addresses>

<Address>
<Name>Anderson</Name>
<House_Name>Melane</House_Name>
<Location>South Venue</Location>
<Place>London</Place>
<Postal_Code>77322</Postal_Code>
<Country>England</Country>
</Address>

<Address>
<Name>Radha</Name>
<House_Name>ThamaraManakkal</House_Name>
<Location>Aleppey</Location>
<Place>Kerala</Place>
<Postal_Code>678221</Postal_Code>
<Country>India</Country>
</Address>

<Address>
<Name>John Smith</Name>
<House_Name>Eden on Earth</House_Name>
<Location>Andhra</Location>
<Place>Mumbai,Maharashtra</Place>
<Postal_Code>823221</Postal_Code>
<Country>India</Country>
</Address>

<Address>
<Name>Siddhanth Marathe</Name>
<House_Name>Gonat</House_Name>
<Location>Juhu</Location>
<Place>Mumbai,Maharashtra</Place>
<Postal_Code>834221</Postal_Code>
<Country>India</Country>
</Address>

<Address>
<Name>Ethen Hunt</Name>
<House_Name>Snow White</House_Name>
<Location>Jenas</Location>
<Place>Miami</Place>
<Postal_Code>23752</Postal_Code>
<Country>America</Country>
</Address>

</Addresses>

--------------------------> Next file

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Employee.xsl" ?>
<Employee_details>
<Employee id="1">
<Employee_Name>Mr.Anderson</Employee_Name>
<Employee_JobId>250</Employee_JobId>
<Employee_JoiningDate>1/15/2007(January 15 2007)</Employee_JoiningDate>
<Employee_Jobsection>Accounts</Employee_Jobsection>
</Employee>
<Employee id="2">
<Employee_Name>Radha</Employee_Name>
<Employee_JobId>255</Employee_JobId>
<Employee_JoiningDate>1/5/2007(January 5 2007)</Employee_JoiningDate>
<Employee_Jobsection>Accounts</Employee_Jobsection>
</Employee>
<Employee id="3">
<Employee_Name>John smith</Employee_Name>
<Employee_JobId>260</Employee_JobId>
<Employee_JoiningDate>2/5/2007(February 5 2007)</Employee_JoiningDate>
<Employee_Jobsection>Maintainence</Employee_Jobsection>
</Employee>
<Employee id="4">
<Employee_Name>Siddhanth Marathe</Employee_Name>
<Employee_JobId>265</Employee_JobId>
<Employee_JoiningDate>2/8/2007(February 8 2007)</Employee_JoiningDate>
<Employee_Jobsection>Software</Employee_Jobsection>
</Employee>
<Employee id="5">
<Employee_Name>Ethen Hunt</Employee_Name>
<Employee_JobId>270</Employee_JobId>
<Employee_JoiningDate>1/1/2007(January 1 2007)</Employee_JoiningDate>
<Employee_Jobsection>Finance</Employee_Jobsection>
</Employee>
<Employee id="7">
<Employee_Name>Prasanth</Employee_Name>
<Employee_JobId>305</Employee_JobId>
<Employee_JoiningDate>11/9/2006(November 9th 2006)</Employee_JoiningDate>
<Employee_Jobsection>Software</Employee_Jobsection>
</Employee>
</Employee_details>
__________________________________________________ ________________

I have created two imaglinks-->one is

EmployeeTab a

and other one is AddressTab

When i click each image link it should display Employee for EmployeeTablink and EmployeeAddress for Employee Addresstablink in the same xsl page. If i am using xsl:if then for test="expression" what value shud i give and how can i initiate Employee and EmployeeAddress xml on the same page for image click?
__________________________________________________ ________________

My xsl:code is as follows


The xsl : file

__________________________________________________ ________________

<xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">

<html>
<body bgcolor="lavender">

<table border="1" align="center">

<tr>
<td width="700" align="center" colspan="5">
<h2>Employee Details</h2>
<hr/>

</td>
</tr>
<tr >
<td width="25%" align="center">
<h4>Employee Id</h4>
</td>
<td width="25%" align="center">
<h4>Employee Name</h4>
</td>
<td width="25%" align="center">
<h4>Job Id</h4>
</td>
<td width="25%" align="center">
<h4>
<em>
<u>view</u>
</em>
</h4>
</td>
</tr>

</table >

<table >
<tr>
<td>
<a href="UpdateEmployeeXml.aspx"></a>
</td>
</tr>
</table>
<table border="0" width="700" align="center" >
<tr>
<td>

<a href="EmployeeSection.xsl">
<img src="C:\Documents and Settings\trainee\My Documents\My Pictures\EmployeeTab.jpg" border="0"/>
</a>

<a href="">
<img src="C:\Documents and Settings\trainee\My Documents\My Pictures\AddressTab.jpg" border="0"/>
</a>
<a href="">
<img src="C:\Documents and Settings\trainee\My Documents\My Pictures\PersonTypeTab.jpg" border="0"/>
</a>
</td>
</tr>
<tr>
<td>
<input type="button" value="New" onclick="location.href='UpdateEmployeeXml.aspx?id= 0'" />
</td>

</tr>

</table>
<table border="1" align="center" width="700" >

<xsl:for-each select="Employee_details/Employee">

<tr>
<td>
<input type="checkbox" name="{name(@id)}" value="" />
</td>
<td width="25%" align="center">
<xsl:value-of select="@id"/></td>
<td width="25%" align="center">
<xsl:value-of select="Employee_Name"/></td>
<td width="25%" align="center">
<xsl:value-of select="Employee_JobId"/></td>
<td width="25%" align="center">
<b>
<h4><a href="UpdateEmployeeXml.aspx?id={@id}">view</a>
</h4>
</b>
</td>

</tr>
</xsl:for-each>
<tr>
<td>
<h4>
<a href="UpdateEmployeeXml.aspx?id=0">ADD</a>
</h4>
</td>
</tr>
</table>

</body>
</html>
</xsl:template>
</xsl:stylesheet>

__________________________________________________ ________________


Please help me if you can it is very urgent.It would be also nice if you could give me tips on how to create good xml pages (ie what type of procedure templates are generally used etc etc.)


Thanks in advance bye Paulson
May 9 '07 #1
4 1158
gomzi
304 100+
Hi all

I got some problems with my xml/xsl.I'm working on asp.net(vb)

These are my xml files. __________________________________________________ ________________

<Addresses>

<Address>
<Name>Anderson</Name>
<House_Name>Melane</House_Name>
<Location>South Venue</Location>
<Place>London</Place>
<Postal_Code>77322</Postal_Code>
<Country>England</Country>
</Address>

<Address>
<Name>Radha</Name>
<House_Name>ThamaraManakkal</House_Name>
<Location>Aleppey</Location>
<Place>Kerala</Place>
<Postal_Code>678221</Postal_Code>
<Country>India</Country>
</Address>

<Address>
<Name>John Smith</Name>
<House_Name>Eden on Earth</House_Name>
<Location>Andhra</Location>
<Place>Mumbai,Maharashtra</Place>
<Postal_Code>823221</Postal_Code>
<Country>India</Country>
</Address>

<Address>
<Name>Siddhanth Marathe</Name>
<House_Name>Gonat</House_Name>
<Location>Juhu</Location>
<Place>Mumbai,Maharashtra</Place>
<Postal_Code>834221</Postal_Code>
<Country>India</Country>
</Address>

<Address>
<Name>Ethen Hunt</Name>
<House_Name>Snow White</House_Name>
<Location>Jenas</Location>
<Place>Miami</Place>
<Postal_Code>23752</Postal_Code>
<Country>America</Country>
</Address>

</Addresses>

--------------------------> Next file

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Employee.xsl" ?>
<Employee_details>
<Employee id="1">
<Employee_Name>Mr.Anderson</Employee_Name>
<Employee_JobId>250</Employee_JobId>
<Employee_JoiningDate>1/15/2007(January 15 2007)</Employee_JoiningDate>
<Employee_Jobsection>Accounts</Employee_Jobsection>
</Employee>
<Employee id="2">
<Employee_Name>Radha</Employee_Name>
<Employee_JobId>255</Employee_JobId>
<Employee_JoiningDate>1/5/2007(January 5 2007)</Employee_JoiningDate>
<Employee_Jobsection>Accounts</Employee_Jobsection>
</Employee>
<Employee id="3">
<Employee_Name>John smith</Employee_Name>
<Employee_JobId>260</Employee_JobId>
<Employee_JoiningDate>2/5/2007(February 5 2007)</Employee_JoiningDate>
<Employee_Jobsection>Maintainence</Employee_Jobsection>
</Employee>
<Employee id="4">
<Employee_Name>Siddhanth Marathe</Employee_Name>
<Employee_JobId>265</Employee_JobId>
<Employee_JoiningDate>2/8/2007(February 8 2007)</Employee_JoiningDate>
<Employee_Jobsection>Software</Employee_Jobsection>
</Employee>
<Employee id="5">
<Employee_Name>Ethen Hunt</Employee_Name>
<Employee_JobId>270</Employee_JobId>
<Employee_JoiningDate>1/1/2007(January 1 2007)</Employee_JoiningDate>
<Employee_Jobsection>Finance</Employee_Jobsection>
</Employee>
<Employee id="7">
<Employee_Name>Prasanth</Employee_Name>
<Employee_JobId>305</Employee_JobId>
<Employee_JoiningDate>11/9/2006(November 9th 2006)</Employee_JoiningDate>
<Employee_Jobsection>Software</Employee_Jobsection>
</Employee>
</Employee_details>
__________________________________________________ ________________

I have created two imaglinks-->one is

EmployeeTab a

and other one is AddressTab

When i click each image link it should display Employee for EmployeeTablink and EmployeeAddress for Employee Addresstablink in the same xsl page. If i am using xsl:if then for test="expression" what value shud i give and how can i initiate Employee and EmployeeAddress xml on the same page for image click?
__________________________________________________ ________________

My xsl:code is as follows


The xsl : file

__________________________________________________ ________________

<xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">

<html>
<body bgcolor="lavender">

<table border="1" align="center">

<tr>
<td width="700" align="center" colspan="5">
<h2>Employee Details</h2>
<hr/>

</td>
</tr>
<tr >
<td width="25%" align="center">
<h4>Employee Id</h4>
</td>
<td width="25%" align="center">
<h4>Employee Name</h4>
</td>
<td width="25%" align="center">
<h4>Job Id</h4>
</td>
<td width="25%" align="center">
<h4>
<em>
<u>view</u>
</em>
</h4>
</td>
</tr>

</table >

<table >
<tr>
<td>
<a href="UpdateEmployeeXml.aspx"></a>
</td>
</tr>
</table>
<table border="0" width="700" align="center" >
<tr>
<td>

<a href="EmployeeSection.xsl">
<img src="C:\Documents and Settings\trainee\My Documents\My Pictures\EmployeeTab.jpg" border="0"/>
</a>

<a href="">
<img src="C:\Documents and Settings\trainee\My Documents\My Pictures\AddressTab.jpg" border="0"/>
</a>
<a href="">
<img src="C:\Documents and Settings\trainee\My Documents\My Pictures\PersonTypeTab.jpg" border="0"/>
</a>
</td>
</tr>
<tr>
<td>
<input type="button" value="New" onclick="location.href='UpdateEmployeeXml.aspx?id= 0'" />
</td>

</tr>

</table>
<table border="1" align="center" width="700" >

<xsl:for-each select="Employee_details/Employee">

<tr>
<td>
<input type="checkbox" name="{name(@id)}" value="" />
</td>
<td width="25%" align="center">
<xsl:value-of select="@id"/></td>
<td width="25%" align="center">
<xsl:value-of select="Employee_Name"/></td>
<td width="25%" align="center">
<xsl:value-of select="Employee_JobId"/></td>
<td width="25%" align="center">
<b>
<h4><a href="UpdateEmployeeXml.aspx?id={@id}">view</a>
</h4>
</b>
</td>

</tr>
</xsl:for-each>
<tr>
<td>
<h4>
<a href="UpdateEmployeeXml.aspx?id=0">ADD</a>
</h4>
</td>
</tr>
</table>

</body>
</html>
</xsl:template>
</xsl:stylesheet>

__________________________________________________ ________________


Please help me if you can it is very urgent.It would be also nice if you could give me tips on how to create good xml pages (ie what type of procedure templates are generally used etc etc.)


Thanks in advance bye Paulson
Don't know how you could achieve that through xsl
But one thing that you could do is this,
Pass the xml file name on the basis of the link that is clicked to the xmldatasource.
then bind the xmldatasource to a dataset and that to a gridview.
May 9 '07 #2
Paulson
63
Hi

I did not get you clearly
can you explain bit more in details?

Thanks in advance bye Paulson
May 9 '07 #3
gomzi
304 100+
Hi

I did not get you clearly
can you explain bit more in details?

Thanks in advance bye Paulson
XmlDataSource is used for reading xml files.
you pass to it the xml file path . the data that is read can be collected in a dataset.
once you have it in a dataset, then you can easily bind it to a datagrid.
May 9 '07 #4
Paulson
63
Hi

I saw your reply and i'm trying not yet succeeded but procedding.Any way thanks for the help.

bye Paulson
May 9 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: j erickson | last post by:
with the following xsl and xml file, the display of the gif file with the <image/url> tag works. However, the gif file in the <description> tag using the name attribute "src" won't make the correct...
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
6
by: Richard | last post by:
<a href="#" name="sample">link 1</a> <a href="#" name="sample">link 2</a> Would this be invalid use of the name? If I wanted to have a function that would be acted upon by detection of the...
36
by: randau | last post by:
I would like to use the Link Target attribute, but am inhibited by the likelihood of a newly opened browser window completely hiding the Parent browser window. Thus offering the illusion that...
4
by: DU | last post by:
I am looking for opinions on the issue of length of title attribute. First of all, the current HTML 4.01 spec is rather vague on this issue... at least, it isn't explicit nor normative. The HTML...
33
by: bissatch | last post by:
Hi, I fully understand the purpose of an alt attribute within a <img> tag but why would you use a title or summary attribute within, for example, a <p> tag. I have read books recommending that I...
3
by: simonZ | last post by:
I would like to add this attribute to content page: <link rel="stylesheet" media="print" title="Printer-Friendly Style" type="text/css" href="printStyle.css"> This attribute should be putted...
4
by: news.internode.on.net | last post by:
Is there any way that a STYLE attribute can be used to control the color of hyperlinks. We have a tabular output generator written in C#. Each column of the table is defined by a column, and...
3
by: Eric Mahurin | last post by:
Is there a standard way to get a descriptor object for an arbitrary object attribute - independent of whether it uses the descriptor/ property protocol or not. I want some kind of...
17
by: biju | last post by:
It is very common to see an image as a link on many web pages. Authors create them by putting an <imgtag inside a <atag. This is very much extra use of another tag. But why browsers dont support...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.