SelectNodes starts-with XPath help

I have the following XML:

<folder name="global">
	<folder name="_images">
		<file name="creative_apply_txt.jpg" />
		<file name="creative_culture_txt.jpg" />
		<file name="push_btn_submit.gif"  />
	<folder name="en">
		<folder name="_images">
			<file name="creative_apply_txt.jpg" />
			<file name="creative_home_txt.jpg" />
			<file name="header_email_notice.gif" />

And I do the following call in my C# application:
XMLImageFileNodeList = XMLDirectoryStructure.SelectNodes(strXPath);

I want to get the node that represent files in the "en" folder that
start with "creative_". I am trying the XPath in two different ways,
neither of which is returning a result:

/folder[@name = 'global']/folder[@name = 'en']/folder[@name =
'_images']/file[starts-with(@name , 'creative_')]

/folder[@name = 'global']/folder[@name = 'en']/folder[@name =
'_images']/file/@name[starts-with(. , 'creative_')]

I've never really worked with the starts-with function before. Am I
doing it right or am I way off base?

Larry Viezel

larryv (2)
7/22/2005 10:43:23 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 10

* Larry Viezel wrote in microsoft.public.dotnet.xml:
>I want to get the node that represent files in the "en" folder that
>start with "creative_". I am trying the XPath in two different ways,
>neither of which is returning a result:
>/folder[@name = 'global']/folder[@name = 'en']/folder[@name =
>'_images']/file[starts-with(@name , 'creative_')]

This is correct.

>/folder[@name = 'global']/folder[@name = 'en']/folder[@name =
>'_images']/file/@name[starts-with(. , 'creative_')]

This is not, you select the @name attributes, not the element
nodes you are interested in.

>I've never really worked with the starts-with function before. Am I
>doing it right or am I way off base?

It's seems your problem is elsewhere. If simple queries like "//file"
do not work either you might have a problem with XML namespaces.
Bj�rn H�hrmann � �
Weinh. Str. 22 � Telefon: +49(0)621/4309674 �
68309 Mannheim � PGP Pub. KeyID: 0xA4357E78 � 
bjoern1 (135)
7/22/2005 11:05:58 PM

Similar Artilces:

how do i start an audit?
I'm looking for information and a basic form to do an audit. This will be the first year that the PTO is doing an audit. We have no idea where to start and how to record our findings and info would be much appreciated. thank you. ...

outlook express 5 help
I have a windows 2000 system that crashed. i backed up the outlook express folder and the applications data folder. I reinstalled Win2k. How do I import all the old Outlook express messages and address book on the new installation? Any help will be greatly appreciated. ...

Need Help understanding code
This code works great but there are several things that I just don't understand. Can Anyone please help. First - I understand the Dim, what is the * 10000 for? Second - GetSetting("Demo", "Drafts", "Month", 0) There is no where in my workbook that refers to "Demo", Drafts", "Month", and what does the 0 do? Third - SaveSetting is that saving both the L and the M when I click the Yes buttom Private Sub Workbook_Open() Dim L As Long, M As Long L = Month(Date) * 10000 + Year(Date) M = GetSetting("Demo", "Drafts", &q...

Signature image help
Hi I am trying to add my company image to my signature in outlook express, but it always makes it an attachment How do I add the image without it being an attachment Thank you -- teezageeza Note that this is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is the link for the right forum Good Luck! -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook...

When start Outlook, it doesn't prompt for the password for PST file.
How to get the "Password for Personal Folder Dialog Box" to appear when Outlook starts. ...

Display the days between start & end date columns
I have two columns one labeled start date, the other Date Completed. I have a third column where I need to display how many days it took to complete the process from start to finish. Do I need a macro? I have no idea how to format the third column to calculate the days between the other two. Hi, Try this un-documented formula =DATEDIF(A1,B1,"d") For help on this formula look here -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still suffic...

Help with a simple print macro
Guys, I have inherited a spreadsheet with a macro built in. The macro is in a sheet and simply prints the next worksheet in the book. However, I've changed just one thing in the sheet to be printed, I've protected it. Now I get the message 'you cannot use this message on a protected sheet' When i depress the debug button it highlights 'Set rng = WS.Range("A1").CurrentRegion '<<< Change' as being the problem. Can this be resolved ? -- Eee One way would be to modify your macro to first "unprotect" the sheet, then do your prin...

Running out of paged/virtual memory when starting Outlook
This problem has only started during the past few days-- previously everything was working fine. Symptoms: Outlook won't load further than the first logo screen, or displays the lists of messages, then immediately crashes, or crashes when you try to open a message. Sometimes an error message appears saying that the Windows installer needs to be present. The performance meter shows that paged memory is maxed out as soon as Outlook is launched. I have increased the virtual memory allowance to the maximum, and have also "repaired" Outlook by reinstalling it from the instal...

Start & End Dates in pivot table
I have data with task Start and End Dates that I need to display in a bar chart. I am having difficulties as some of the Start date could begin in Jan, but end in Mar, Some begin in Jan and end in Jul, What I need is for the pivot table to create a chart that shows in Jan there are 'X' number of tasks, this should follow through until Mar, for the first then Jul for the next example, but it doesn't. What I get instead is 2 tasks in Jan, then none for the rest of the year. Grouping doesn't work as I need to see every month and every task. i.e. Task 1 should appear on the c...

Has anyone got an implementation of SelectNodes that works for CF? OpenNetCF doesn't seem to have one... Thanks, Peter Peter, The thing i do is simply get the XmlNodeList of children of the current node I wish to evaluate, then iterate through each til i have the child node i wish. Then get the next XmlNodeList of this current node, etc etc, until i get the node i need. It's a pain, looks a bit messy in the code, but works reasonably well. The reason no one's done this is because of the restriction of resources on a CE device... Ideally you'd want to move away from XML an...

Receivables Trial Balance Help
Can someone please explain to me the difference between the current column and the 0-30 days column on this report? Please help me. Thanks BK, There are two choices to display the aging - 1. Age based on invoice date 2. Age based on due date When you select to age based on due date, the Current bucket represents invoices that are from 0-30 days old. The 0-30 days bucket represents invoices that are 0-30 days past due. The method of aging is set in Receivables setup as are the bucket headings. If you age based on invoice date, the the buckets would be Current, 31-60, 61-90, etc. Fr...

Looking for coding help for a specific design
Ok hoping you guys can help me like you have in the past. I am trying to create a user form to display customer details in a particular way. The form is in 3 columns Col1 = vertical scrolling column to show all customers name (you highlight the name you want not double click) Col2 = Box showing address of highlighted selection Col3 = Box showing further details from another section of the database ie prices I saw this setup on a fancy Nokkia mobile phone and just saw it as a great layout, the part that I will struggle on is creating the coding for when I highlight. Table...

How start Acrobat with a certain doc from my C++ App?
How can I start AcrobatReader and have it open a certain document (by use of the full path & file-name) from my C++ code. Should also work for basicly any registered document- type i.e. Word etc. Any ideas? brgrds & thanks: Nils Hello 1)You can use ShellExecute() and specify the PDF file as the program to be executed. This will work if PDF is registered with AcroBat. This method works with any registered document. 2)Use WinExec or any other program spwaning facility to run AcroRd32.exe and specify the PDF file as the parameter. Regards, Elias "Nils" <Nils@dcc-onlin...

Help for Stan
There is always help for the sick in America taken back by jobs from The Chinese peopele who don't know how to spell this is the truth. Asking psychiatrists to enter their time quickly on time cards presented to the elite after dinner is just what Stan wanted. I do beliieve that the spelling is a major or did I say majer qualifying element of the sickness? You decide. ...

Import Help
I have a billing system I am developing for a client. They would like to export the data from that system into their Dynamics GP system. The purpose is to be able to generate invoices without having to re-enter the information. I am trying to determine what the best method for doing this is. Any help is greatly appreciated! Mike, Thanks for the quick reply! I do not have any experience with Dynamics GP. Unfortunately at this stage I haven't even seen the product. The company is a non-profit agency that deals with developmentally disabled people. They have very a limited budget. Is e-Co...

need help
I have a worksheet was setup to allow users to access certain ranges even the sheet is protected. I deleted one of the ranges from the Allow Users Edit Ranges windows which users should not have access to it anymore, however, the deleted range was accessible even the sheet is protected. Why? Just to experiment, I deleted all ranges from the Allow Users Edit Ranges windows, therefore, users should not be able to edit the entire worksheet when the sheet is protected, however, I was able to access all ranges that previous setup to allow users to edit. Any ideas? ...

xpath again
Hi again, I'm using the following xpath (works in visualizer) with a SelectSingleNode("xpath") statement. //Station[@name="Station1"]/(WI[Boards/Board[@sn="583230"][@finish]])[la st()]]/@order Problem is I get an error "expression passed to this method should result in a NodeSet". Of course, that (sort of) makes sense to me now (I suppose just an attribute couldn't be a nodeset, but how would I go about: I need to determine if and what <WI> element is the parent of the last <Board> is according to the above xpath. I then need to ...

Is there any who can help in understanding the VLOOKUP function
I am trying to use VLookup function for my report generation. I have data of approx. 20000 rows. Start here: Regards Rowan Ajay wrote: > I am trying to use VLookup function for my report generation. > I have data of approx. 20000 rows. > ...

Starting problem
Hy my name s Felipe and this is my 1st post here. I tried to find that info in Google before posting here but there is just too much garbage and I could not find it. My problem is this: My bank insue statements that when I upload into Money the description of the PAYEE is in the MEMO field this makes my life more complicated because I have to manually use "find and replace" every time (weekly) I upload a new statement. I guess such a nice software does have a way to specify that everytime I upload this statement it read the value in the MEMO field and throw it in the PAYEE fi...

Hi Everybody. I'm new to this group and need your help please. I just bought Microsoft Publisher 2003 (OEM) and installed it on my computer. I am running a Pentium 1.7ghz with 512MB and 2 - 36GB Hard Drives.(Ultra wide SCSI II) I have AVG as my anti-virus and am using windows XP firewall. My problem is everytine I open Publisher, it crashes, and I get an error message saying its sorry it has encounted a prroblem and must close. I have all of my updates installed and up to date. So what's the problem? Why does Publisher keep crashing? Microsoft won't help me cus its OEM. ...

start up problem 12-29-09
windows doesn't start get error message: windows\driver\pci.sys missing or corrupted reloaded windows xp twice and after 48 hours problem again any ideas? On Dec 29, 1:27=A0am, backten <> wrote: > windows doesn't start get error message: > windows\driver\pci.sys missing or corrupted > reloaded windows xp twice and after 48 hours problem again > any ideas? Do you mean something like: Windows could not start because the following file is missing or corrupt: System32\drivers\pci.sys It could be that the pci.sys file re...

Outlook wont start after exit
Hi there I have installed Outlook 2003 along with the MS-Office on a Notbook after I transfered all Outlook settings via "File and Settings Transfer Wizzard". Unfortunatelly Outlook shows some problems! It seems like Outlook is going in HANG mode after exiting the Outlook. If I try to start Outlook first it looks like it is loading and bulding up all needed data but then it freezes and nothing helps exept stoping through the tasklist of Windows. Then again even if I END Outlook it resists to start (same symptoms) Only after restarting Windows Outlook follows starting. Has somebo...

Wlm help :| :|
i recently purchased a new laptop and went to install wlm on it, it then installed the latest version which i later found to only allow video calls on, i then tried to to install a previous version but as it was the online installer it updated automatically, so can anyone tell me where a working download of the offline installer of Windows Live Messenger 2009 (14.0.8064) is? thankyou, btw preferably not off rapidshare. -- ollyrennard Greetings, Right here on my blog: Just download the MSI and run. Note that if yo...

How to get formulas starting from the referenced cells
Hi all, I've cells on a sheet which are referenced by formulas which are on different sheets (about 20) on the same workbook, and I'm looking for a way to get all these formulas. I've tried: 1) The Trace command, but I see only a table icon every time I've this type of reference 2) The Find command, but there are cell references wrote in different manners (ie B2, $B2, B$2, $B$2), and formulas which refer to results of other formulas that refer to the cells, so it's not so simple to trace all the dependencies Any help is appreciated Thanks Dario I'm not sure I full...

Start Access after logging-in
Using Access 2000. Users have restricted access to B/E files in the server based on the VB Script associated with their UserName. For example USERr 1 has access to files in dirve Q only, or USER 2 has access to drives Q and R. No problem here. My Q. is: Can the VB Script open automatically a F/E file? For example, when USER 1 logs-in his F/E file opens automatically. Also, once users quit/exit the F/E can they automatically be logged-off? Or, If you can give a newsgroup that could help me, it will be greatly appreciated. Thanks. Never mind... I fuigured it out... "Ricoy-Chi...