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

Xpath Help!

In ASP i used XMLDataSource to create a small menu. For the following xml how would i get just the @nav value and create a small navigation menu like this:

Menu architecture: exhibition publication review

So far i have this:

Expand|Select|Wrap|Line Numbers
  1. <asp:XmlDataSource id="MySource" DataFile='architecture.xml' XPath='/architecture' runat="server"/>
  2.  
  3. <div id="nav">Menu
  4.         <asp:Repeater id="xml" DataSourceId="MySource" runat="server">
  5.         <ItemTemplate><h1><%# XPath("@fullname")%>: </h1>
  6.                 <asp:Repeater id="nav" DataSource='<%# XPathSelect("@nav") %>' runat="server">
  7.                 <ItemTemplate>   
  8.                     <a href="#"><%# XPath(".")%></a>
  9.                 </ItemTemplate>
  10.                 </asp:Repeater>
  11.         </ItemTemplate>
  12.         </asp:Repeater>
  13. </div>
  14.  
  15.  
  16.  
  17. [architecture.xml]
  18. <?xml version="1.0" encoding="iso-8859-1"?>
  19. <architecture fullname="architecture">
  20.     <exhibition nav="exhibition">
  21.     </exhibition>
  22.  
  23.     <publications nav="publication">
  24.     </publications>
  25.  
  26.     <images nav="image">
  27.     </images>
  28.  
  29.     <reviews nav="review">
  30.     </reviews>
  31. </architecture>
  32.  
Thanks for your help!!
Jan 1 '08 #1
2 1376
jkmyoung
2,057 Expert 2GB
Why not image as well? Is there a list of the ones that you do display?

xpath could be:
//*/@nav
Jan 3 '08 #2
sorry yea including image, and yes it worked! Thanks for your help!
Jan 5 '08 #3

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

Similar topics

0
by: bdinmstig | last post by:
I am building various framework components for my team to use in development, and one of those components is a Facade for reading/writing user preferences. The idea is that preference settings...
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
8
by: Terry P | last post by:
Are there any tools (java classes, tag libraries) which can translate xpath statements into a SQL query? Given an xpath query which has a predicate that filters node values or attributes, I want...
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...
2
by: Locusta | last post by:
Hello, I would like to use XPATH in a C program to retrieve values from XML documents. Did anyone tried this and can give me some advice? Cheers, Locusta
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.