Finding the right entry

Hello Community,

it's again me with my next problem. As I mentioned, I'm pretty new in 
programming and have no clue about all this different techniques. So I hope 
you can help me.

What I wanna do is theoretically simple. Providing a phonenumber  to an URL 
over the internet I get the complete phonebook entries (companyname, street, 
city...).  The received data are packed in a atom-feed (that's a sort of 
specific xml).  The following code shows how the call should work:

    Private Sub RetrieveWebEntries()
        Dim url As String
        Dim xmlDoc As New XmlDocument()
        Dim rssFeed As HttpWebRequest
        Dim element As XmlElement

        url = "http://tel.search.ch/api/?was=0319984589&key=mykey"

        rssFeed = WebRequest.Create(rssUrl)

        If rssFeed IsNot Nothing Then
            xmlDoc.Load(rssFeed.GetResponse().GetResponseStream())
        End If

        element = xmlDoc.GetElementById("tel:firstname")

        Return xmlDoc
    End Sub

If i have a look in the xmlDoc.outerXML this is what I get:

  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <feed xml:lang="de" xmlns="http://www.w3.org/2005/Atom" 
xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" 
xmlns:tel="http://tel.search.ch/api/spec/result/1.0/">
  <id>http://tel.search.ch/api/8f527a80ea99ac0922a55242ad61f207/e200bbd80c50d55fcac271ca3194ff2c</id>
  <title type="text">tel.search.ch API Search Results</title>
  <generator version="1.0" 
uri="http://tel.search.ch">tel.search.ch</generator>
  <updated>2010-01-19T03:00:00Z</updated>
  <link href="http://tel.search.ch/result.html?was=0319984589" 
rel="alternate" type="text/html" />
  <link href="http://tel.search.ch/api/?was=0319984589&key=mykey" 
type="application/atom+xml" rel="self" />
  <openSearch:totalResults>1</openSearch:totalResults>
  <openSearch:startIndex>1</openSearch:startIndex>
  <openSearch:itemsPerPage>10</openSearch:itemsPerPage>
  <openSearch:Query role="request" searchTerms="0319984589" startPage="1" />
  <openSearch:Image height="1" width="1" 
type="image/gif">http://www.search.ch/audit/CP/tel/de/api</openSearch:Image>
- <entry>
  <id>urn:uuid:40ee9f656a59df9b</id>
  <updated>2010-01-19T03:00:00Z</updated>
  <published>2010-01-19T03:00:00Z</published>
  <title type="text">Microsoft Schweiz GmbH</title>
  <content type="text">Microsoft Schweiz GmbH Morgenstrasse 129 3000 Bern/BE 
031 998 45 89</content>
- <author>
  <name>tel.search.ch</name>
  </author>
  <link 
href="http://tel.search.ch/bern/morgenstrasse-129/microsoft-schweiz-gmbh" 
title="Details" rel="alternate" type="text/html" />
  <link 
href="http://tel.search.ch/vcard/MicrosoftSchweizGmbH.vcf?key=40ee9f656a59df9b" 
type="text/x-vcard" title="VCard Download" rel="alternate" />
  <link href="http://tel.search.ch/edit/?id=40ee9f656a59df9b" rel="edit" 
type="text/html" />
  <tel:pos>1</tel:pos>
  <tel:id>40ee9f656a59df9b</tel:id>
  <tel:type>Organisation</tel:type>
  <tel:name>Microsoft Schweiz GmbH</tel:name>
  <tel:occupation />
  <tel:street>Morgenstrasse</tel:street>
  <tel:streetno>129</tel:streetno>
  <tel:zip>3000</tel:zip>
  <tel:city>Bern</tel:city>
  <tel:canton>BE</tel:canton>
  <tel:category>Softwareentwicklung</tel:category>
  <tel:category>Computer & Peripherieger�te Grosshandel</tel:category>
  <tel:extra type="fax">+41319984589</tel:extra>
  </entry>
  </feed>

No i would like to exctract all the information who start with <tel: >
I tried first looping throug every childnode but nothing. Then I tried using 
"element = xmlDoc.GetElementById("tel:firstname")"
Can it be as complicated? What am I doing wrong? How can I put this outerXML 
(who's a string) in a XML?

Thanks in advance

Trudy 

0
just.spam (2)
1/19/2010 3:19:47 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
1845 Views

Similar Articles

[PageSpeed] 38

Trudy Momo wrote:

> What I wanna do is theoretically simple. Providing a phonenumber  to an 
> URL over the internet I get the complete phonebook entries (companyname, 
> street, city...).  The received data are packed in a atom-feed (that's a 
> sort of specific xml).  The following code shows how the call should work:
> 
>    Private Sub RetrieveWebEntries()
>        Dim url As String
>        Dim xmlDoc As New XmlDocument()
>        Dim rssFeed As HttpWebRequest
>        Dim element As XmlElement
> 
>        url = "http://tel.search.ch/api/?was=0319984589&key=mykey"
> 
>        rssFeed = WebRequest.Create(rssUrl)
> 
>        If rssFeed IsNot Nothing Then
>            xmlDoc.Load(rssFeed.GetResponse().GetResponseStream())
>        End If

There is no need to mess with WebRequest and response and response 
stream, it suffices to use
          xmlDoc.Load(url)

> No i would like to exctract all the information who start with <tel: >

You can use XPath to do that e.g.

         Dim nsMgr As New XmlNamespaceManager(xmlDoc.NameTable)
         nsMgr.AddNamespace("tel", 
"http://tel.search.ch/api/spec/result/1.0/")

         For Each element As XmlElement In 
xmlDoc.SelectNodes("descendant::tel:*", nsMgr)
             Console.WriteLine("Element named ""{0}"" has content 
""{1}""", element.LocalName, element.InnerText)
         Next

-- 

	Martin Honnen --- MVP XML
	http://msmvps.com/blogs/martin_honnen/
0
mahotrash (1777)
1/19/2010 4:47:30 PM
It works great!

Martin, thank you a lot. You made my day =)

Have a nice day

Trudy

"Martin Honnen" <mahotrash@yahoo.de> schrieb im Newsbeitrag 
news:O4bpZcSmKHA.1536@TK2MSFTNGP06.phx.gbl...
> Trudy Momo wrote:
>
>> What I wanna do is theoretically simple. Providing a phonenumber  to an 
>> URL over the internet I get the complete phonebook entries (companyname, 
>> street, city...).  The received data are packed in a atom-feed (that's a 
>> sort of specific xml).  The following code shows how the call should 
>> work:
>>
>>    Private Sub RetrieveWebEntries()
>>        Dim url As String
>>        Dim xmlDoc As New XmlDocument()
>>        Dim rssFeed As HttpWebRequest
>>        Dim element As XmlElement
>>
>>        url = "http://tel.search.ch/api/?was=0319984589&key=mykey"
>>
>>        rssFeed = WebRequest.Create(rssUrl)
>>
>>        If rssFeed IsNot Nothing Then
>>            xmlDoc.Load(rssFeed.GetResponse().GetResponseStream())
>>        End If
>
> There is no need to mess with WebRequest and response and response stream, 
> it suffices to use
>          xmlDoc.Load(url)
>
>> No i would like to exctract all the information who start with <tel: >
>
> You can use XPath to do that e.g.
>
>         Dim nsMgr As New XmlNamespaceManager(xmlDoc.NameTable)
>         nsMgr.AddNamespace("tel", 
> "http://tel.search.ch/api/spec/result/1.0/")
>
>         For Each element As XmlElement In 
> xmlDoc.SelectNodes("descendant::tel:*", nsMgr)
>             Console.WriteLine("Element named ""{0}"" has content ""{1}""", 
> element.LocalName, element.InnerText)
>         Next
>
> -- 
>
> Martin Honnen --- MVP XML
> http://msmvps.com/blogs/martin_honnen/ 

0
just.spam (2)
1/20/2010 7:18:29 AM
Reply:

Similar Artilces:

move objects between group policies rights
I would like to be able to allow user to manage group policy but not active directory. However I need the abiltiy for that user to be able to move users and computer in and out of different organizational groups to receive differenet GP settings. Is there a way to do this and limit users role in active directory to only allow objects to be moved in and out of GPOs? It is fine to have full control of Group Policy. Howdie! 2010 wrote: > I would like to be able to allow user to manage group policy but not active > directory. However I need the abiltiy for that user to ...

Money 2004
I download my 401k statement from Fidelity and I have a question about the transaction dates that Money comes up with. For instance, today I went to the Fidelity site to look at my account balances and transaction history. I see that yesterday (9/15) my company made the latest deposit to the 401k for my contributions and the company match amounts. These funds purchased shares in the funds that I elected. The date on these transactions is 9/15. However, when I go into Money and ask to download the latest statement from Fidelity and I read and import that statement into my Money 401k account...

Find all cells with a number and mulitply
How can I find all cells in a sheet that are a number greater than zero and multiply each one by a number? IE: the number to multiply by is 1.2 A1 Tom A2 25 A3 0 G12 Bob G13 25 I want to programatically (without using a macro) find cells a2 and g13 only and multiply them by 1.2 Thanks in advance for your help. Jim Jim, As long as you don't have any negative numbers, it doesn't matter about being > 0 (0*n=0) or being text. Try this Put 1.2 in a spare cell and then copy it Select all the cells Goto menu Edit>Pastespecial Click the Multiply option OK out Now clear the c...

Entry Point not found #2
On startingOutlook XP, I am getting following multiple windows under Title "CiceroUIWndFrame: OUTLOOK.EXE =Entry Point Not Found" - "The procedure entry point GetIUMS could not be located in the dynamic link library MSDART.DLL" Edward H Have you recently updated MDAC on this machine? If not, you might want to try updating that component (I think MSDART/MSDART32 is part of it) "Edward Harford" <eharford@apsconsortium.co.uk> wrote in message news:uRVdEYN4DHA.360@TK2MSFTNGP12.phx.gbl... > On startingOutlook XP, I am getting following multiple window...

data entry problem
I am trying to make a detailed sheet of some inventory data whic changes each month. The first sheet just has general data, but ther are more columns on the second sheet with varying expanded details Column A - product number Column B - color Column C - available Column D - Misc notes (may or may not be filled in) [SHEET 1] Month 1 A B C D 2310 blue yes 2348 red M/R must sell soon 2362 blue no (some text data in-between) 2405 red M/R need to be redone 2450 grn yes sell cheap 2477 wh yes Month 2 (new ones may be added, and sold item t...

Money 2000 prompting on entries.
My Money program has begun requiring a confirmation "Do you want to enter this transaction?" before each entry into our program. It recently started this and I don't know what I did to cause it or how to change it back to no prompts for each single entry. I'm not even sure what the setting does, but you might want to clear Tools|Options|Editing|Confirm changes to transactions. "Kathy" <anonymous@discussions.microsoft.com> wrote in message news:039e01c3b6f8$9cd5d570$a301280a@phx.gbl... > My Money program has begun requiring a confirmation "Do >...

Price Levels with Price Entry at POS
We are having an issue with customer price levels and items with open prices. If a customer is set to Price Level A (it doesn't matter which), and is selected at the point of sale, if you try to add an item to the transaction that has "Must enter price at POS" selected, no matter what price you enter, it will automatically revert to the price listed in Price Level A. Is there a solution to this? ...

Journal entry # has been entered in another window
While importing GL history data for a new company, we ran into an issue with a journal entry number. Possibly another user was in at the same time, but even after everyone is out and all windows are closed we still get the same message: "Journal entry 5 has been entered in another window". We could always use a new journal number to enter the transaction but how to we delete/void this particular JE ? From KnowledgeBase Article ID: 863850 1. Exit out of Dynamics. 2. Rename, do NOT delete, the GL Transaction Work file, GL10000.*, in the Finance folder for your company. 3. Launch D...

Find supplies that are not used
Our partner added about 2000 general industry suppliers when they created our database. Problem is, we only use about 200 of them and it makes it difficult having to always go through all these useless suppliers. Is there a query we can run to find/delete suppliers that do not have any products attached to them Cheers Hi Jetspeed, You can run this query to see which suppliers has products (Go SO Admin> Go to File and then Connect to Database > Then click on Query > New) select * from supplier where id in (select supplierid from supplierlist) You can now run the following que...

who can I protect with password the Interchange entry
Hi, I'm trying to protect the Interchange entry with a password, in GP8 I used the general password but, I did update to GP9 and this protection was eliminated and all the user can change or entry a new interchange rate. Who can protect this?. Armando Sanchez This was removed in GP 9.0 because it was accidently added to the window in 8.0 (it wasn't previously). You can use regular GP security to keep everyone you want out of the window. The only other solutions I can think of are: 1. Dexterity customization - pretty easy 2. VBA coding but not as secure but would work. 3. I thi...

where are old calendar entries?
I use Outlook 2003 and synch it to my HTC Tilt 2. I use the Tilt as a phone, calendar, Tasks list (which is very important for me), Notes, Contacts list, camera on occasion, but not for anything Web or Wi-Fi or e-mail. Old calendar entries are missing from Outlook. For example, I went on a cruise for a wedding last November, had it in Outlook, but it no longer shows in there. Neither are other-related entries, i.e., flight numbers and times, limo pick up info, the wedding details. However, a March '11 entry related to this same wedding is still there. This is important to me, I use th...

Expanding/Contracting Form depending on data entry requirements
[I'm building a DVD database for personal use, and am not a Access/VB expert] I've put the Film Details and the DVD Inventory in different tables, as I might have multiple copies of the same movie, and don't want to be entering that information more often than necessary. When adding to the inventory I've used a combo box fro the just the Film Title. If the correct one is not there, then there is a button to open up another form to enter in the film title, I just wondered if it was possible to embed that form in the main form, such that if the title is missing clickig ...

Outlook 2000 can't find Word (email editor)
Just purchased a new computer with XP Home Edition OS. Also came a trial version of Office 2003. I already had Office Pro 2002 and installed it. I did not uninstall the trial version of 2003 first. The trial version is in an office 11 folder. The older version is in an office 10 folder. When I attempt to send an email through outlook 2000, a message pops up indicating that outlook can't find word so it will use the outlook editor. Can you help? Thanks, Martin I think Windows and Outlook are terribly confused about what's installed where. There is probably some registry...

Cannot start Money 2004, it kills itself right away
Hi everyone, Today for no reason, I cannot start Money 2004. After I enter my password, it kills itself right away. Anyone knows what is going on and how to fix the problem? Thanks. In microsoft.public.money, CannotStartMoney2004 wrote: >Hi everyone, > >Today for no reason, I cannot start Money 2004. After I enter my password, >it kills itself right away. Anyone knows what is going on and how to fix the >problem??Thanks. Consider File->Restore of your newest or second-newest *.mbf files. Rather than restoring to the "default location", you can choose a diff...

How to force entry in cell before saving.
Is there a way to force users to fill in specific cells in a spreadsheet before printing or saving the spreadsheet in Excel? -*-Mike-*- look in the ThisWorkbook vba module for workbook>before print and before save events. "Mike Okuley" <Mike@okuley.com> wrote in message news:022701c370b7$ab9216f0$a301280a@phx.gbl... > Is there a way to force users to fill in specific cells in > a spreadsheet before printing or saving the spreadsheet in > Excel? > > -*-Mike-*- Thands much Don for the quick response. -*-Mike-*- >-----Original Message----- >look ...

find existence of autotext entries
I'm cleaning up some code from a previous programmer who liked to put "On Error Resume Next" in places where he didnt' know how to test things in lines above code that might crash. For example, there are lines like the following: Selection.InsertAfter "krh" On Error Resume Next Selection.Range.InsertAutoText I really want to take otu the "On Error Resume Next" and replace it with a test to see if the AutoTextEntry exists as follows: Selection.InsertAfter "krh" If <autotext entry("krh")> exists Then Selecti...

WMP11: Finding tracks that are not in my default location
I have "Add media files to library when played" so I have a proportion of my files outside my main media directory. Is there an easy way to find these files? I can write an OLE program, but I'm feeling lazy. I've just bought a Logitech Squeezebox Duet, and its media server uses a single root directory. It follows shortcuts though, so once I've found the "outlying areas", I can point to them. -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk WMP's Folder view could be useful for this, just click the Folder item...

Lookup latest entry 1
Hi all! I was wondering if I can get some Excel help for a problem I have encountered: Below is a list of the field names corresponding to the columns in Excel (separated by comma's): LastName, FirstName, RepID, Sales, UpdateNumber I input information from various sources into this spreadsheet. I have another spreadsheet set up which uses the data from above to do some calculations. To make my request simple, I'll provide an example. Let's say I have the following 10 entries in the database: LastName, FirstName, RepID, Sales, UpdateNumber Miller, John, CA23, 52000, 1 Tal...

Finding Duplicate Entries
Using XP Pro SP2 and Excel XP (2002) Like to know if it is possible find all duplicate entries?. Can not use a starting string because it's unknown having all kinds of possibilities. I text pasted a file directory with paths and filenames, I can have duplicate filenames in different directories, and like to search for duplicate names if possible. The list was entered in delimited based on "\" which will be in it's own column, dependent on how many sub-folders. At this stage, I am interested in only finding duplicate file naming. Not concerned if these files are ide...

updated balance w/o registry entries
my money 05 has updated my balance from the Bank of America, however some of the transactions do not appear in the register. None of these are pending transactions. Does anyone know why this happens? -- Cheers, Tom G. Essential Register? All bets are off... "Tom G" <123mpel@vms.huji.ac.il> wrote in message news:e77OVXgFFHA.3312@TK2MSFTNGP15.phx.gbl... > my money 05 has updated my balance from the Bank of America, however some of > the transactions do not appear in the register. > > None of these are pending transactions. > > Does anyone know why this...

sales transaction entry 12-17-09
When a sales transaction occurs what tables are affected? The main tables are SOP10100 and SOP10200 for Open Invoice / Orders, and SOP30200 and SOP30300 for History, there are other within the range for Comments, Serial / Lot Numberes if you need that detail. Mick "Larry C" wrote: > When a sales transaction occurs what tables are affected? Hi Larry, You can install the SDK from CD2 to provide you with greater details. Saved SY00500 – Batch Header SOP10100 – SOP_HDR_WORK SOP10200 – SOP_LINE_WORK Other Tables SOP10101 SOP_Commission_WORK_HIST SOP10102 ...

where can i find the attachment tab so it shows continuously
Before upgrading my office pc to Windows 7 i used Office 2007 and emails always had to: cc: bcc: and attachment beside the send button...now i can't find it, anyway have any ideas ...thanks in advance Click on the View button. You'll find BCC there. Also under the View button you can find Toolbars. Make sure you've clicked on Standard and Formatting to enable them. -- Kathleen Orland "Lorraine" <Lorraine@discussions.microsoft.com> wrote in message news:A2EADC8D-25D7-4410-9E9A-1ECA4517E02C@microsoft.com... > Before upgrading my office pc to W...

WMP will not find album information or connecto to Media Guide.
I'm using WMP 11 on Vista. Whenever I right click an album and "find album information" the window pops up and the globe in the top left corner spins but the window remains blank. I try to refresh by clicking the globe but nothing ever loads. It's the same story for using the media guide. Blank white page. I've reset IE, checked the firewall settings (even turning it off for a moment), confirmed all of the settings in WMP but I still can't find any album information. Does anyone have a solution to this issue? In the past I was able to use the ...

Can't find Microsoft.Office.Workflow.Tasks' dll
Hi, I am new to sharepoint. We only have WSS 3.0 at work; we don't have MOSS yet. I am trying to work with VS2008 to do workflow (perhaps more later). I installed VS2008 on our server that runs WSS. I was able to start a sharepoint workflow project using the VS2008 template. I did get that first screen you get with the canvas and the "onworkflowactivated" component. When I tried to run the workflow I got messages telling me that the project couldn't find 'Microsoft.Office.Workflow.Tasks' could not be found. I tried including that dll in the using...

Can't find IV
I have an Excel schedule that I can import data from GP V9 using table IV00500, "QTY Avail" field. I used this worksheet weekly for our production schedule and it worked wonderfully until I upgraded to V10 SP3 last week. Now, table IV00500 does not exist and I can't find the QTY Avail field in any other table. Does anybody know which tables I can find this field? I found the QTY On Hand field but I need the QTY Avail field. Help! -- MCEng MC, I did a search for the field and it appears in 10.0 that it is included only in temp tables. Makes sense since QTY Available i...