473,383 Members | 1,837 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,383 software developers and data experts.

GridView and XML/XPath Problem!

hello!

following is xml file:

'=====================
<Root>
<groups id="1">
<author id="1">author 11</author>
<author id="2">author 12</author>
<author id="3">author 13</author>
<author id="4">author 14</author>
<author id="5">author 15</author>
</groups>
<groups id="2">
<author id="1">author 21</author>
<author id="2">author 22</author>
<author id="3">author 23</author>
</groups>
<groups id="3">
<author id="1">author 31</author>
<author id="2">author 32</author>
<author id="3">author 33</author>
<author id="4">author 34</author>
</groups>
</Root>
'=====================

following is asp.net code :

<h3>test-1</h3>

<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="GridView_Xml_Edit_DataSet.xml"/>
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" datasourceid="XmlDataSource1">
<columns>
<asp:TemplateField>

<HeaderTemplate>
Authors
</HeaderTemplate>

<ItemTemplate>
<%#XPath("groups[2]/*")%>
<%-- <%#XPath("groups[2]/author/.")%>
--%>
</ItemTemplate>

</asp:TemplateField>
</columns>
</asp:gridview>

<hr />

<h3>test-2</h3>
<%-- XmlDataSource and ItemTemplate ***** --%>
<asp:XmlDataSource ID="XmlDataSource2" runat="server" DataFile="GridView_Xml_Edit_DataSet.xml" XPath="//groups[2]/author/."/>

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="XmlDataSource1">
<Columns>
<asp:BoundField DataField="id" HeaderText="Authors"/>
</Columns>
</asp:GridView>

<%-- the end --%>

i need gridview results for :
'--------------------------------------
ID Autor
1 author 21
2 author 22
3 author 23
'-------------------------------------

no properly result.

?????????????????
Sep 17 '07 #1
2 1368
kenobewan
4,871 Expert 4TB
Are you receiving an error or what is the outcome? Thanks.
Sep 17 '07 #2
Are you receiving an error or what is the outcome? Thanks.
thank's for reply.

no error. i'm result is:

id
'----------------------
1
2
3
'----------------------
Sep 20 '07 #3

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

Similar topics

0
by: gael.pegliasco | last post by:
Hi, How are you dear and nice helper :) ? I'm trying to test xpath with this simple program : import xml.dom.minidom from xml.xpath.Context import Context import xml.xpath
4
by: Son KwonNam | last post by:
In XSLT, is this possible to get value from xml using XPath which is in XSLT variable? I mean XPath strings can be dynamic while XSL Transforming. If possible, How?? Because I'm not a...
3
by: Kathy Burke | last post by:
Hi again, I'm using the following xpath (works in visualizer) with a SelectSingleNode("xpath") statement. //Station/(WI])]/@order Problem is I get an error "expression passed to this method...
4
by: Alexander Widera | last post by:
Hi, I have the following source code: <%@ Register tagprefix="my" tagname="tcontrol" Src="article_small.ascx" %> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$...
6
by: tfsmag | last post by:
I have a Grid that I've set up to have two of the fields use dropdownlists while in edit mode. Now I can bind the data to the dropdownlists just fine. My problem is that the second dropdown depends...
4
by: Congero | last post by:
I'm trying to find a way to bind hierarchical data to a gridview control. I've been able to do this with some third party controls and was wondering if this functionality is available with the...
3
by: Opa | last post by:
Hi, I have and XMLDataSource which I am using in a GridView control and am customizing the grid with <ItemTemplate>. My XML datasource has an element with an attribute called "private". I want...
2
by: Rob | last post by:
Hi, Firstly, Happy Easter! I'm trying to bind some XML data to a .net control and it looks like it should be easy - except it's completely stumped me! I have a GridView control which is...
5
by: jorgedelgadolopez | last post by:
Hi all, I am using the xpathnavigator evaluate function on .net (xpath 1 right?). Now I need to expand the code to do multiple contains, compare dates (such as 'before', 'between' and 'after'),...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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

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.