XML Dateihandling

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • XML Dateihandling

    Hallo ich ahbe ein XML datei mit folgender struktur:
    [code:1]<menu>
    <meal>
    <id>1</id>
    <name>Magerita</name>
    <price>5</price>
    </meal>
    <meal>
    <id>2</id>
    <name>Salami</name>
    <price>7</price>
    </meal>
    </menu>[/code:1]

    Ich möchte gerne die möglichkeit haben nach der id zu suchen und den preis von dem produkt zurückbekommen. Wie realisier ich dies am besten?
  • Ich würde die einzelnen "Meal"-Abschnitte in ein Array speichern. Dann könntest du über Array[X] einfach auf das Meal zugreifen, dass du haben willst und dir den Preis ausgeben lassen.
    Was wir wissen ist ein Tropfen, was wir nicht wissen ein Ozean.

    www.bussgeldkataloge.eu - Die Seite für Autofahrer
  • “To be or not to be”. Outside the Bible, there six words are the most famous in all the literature of the world. They were spoken by Hamlet when he was thinking aloud, and they are the most famous words in Shakespeare because Hamlet was speaking not only foe himself but for every thinking man and woman. To be or not to be-to live or not to live, to live richly and abundantly and eagerly, or to live dully and meanly and scarcely. A philosopher once wanted to know whether he was alive or not, which is a good question for everyone to put to himself occasionally. He answered it by saying:“I think, therefore I am.”(world of warcraft gold)

    But the best definition of existence I ever saw was one written by another philosopher who said:“To be is to be in relations.”If this is true, then the more relations a living thing has, the more relations a living thing has, the more it is alive. To live abundantly means simply to increase the range and intensity of our relations. Unfortunately we are so constituted that we get to love our routine. But apart from our regular occupation how much are we alive? If you are interested only in your regular occupation, you are alive only to that extent. So far as other things are concerned-poetry and prose, music, pictures, sports, unselfish friendships, politics, international affairs-you are dead.buy wow gold

    Contrariwise, it is true that every time you acquire a new interest-even more, a new accomplishment-you increase your power of life. No one who is deeply interested in a large variety of subjects can remain unhappy, the real pessimist is the person who has lost interest.

    Bacon said that a man dies as often as he loss a friend. But we gain new life by contacts, new friends. What is supremely true of living objects is only less true of ideas, which are also alive. Where your thoughts are, there will your life be also. If your thoughts are confined only to your business, only to your physical welfare, only to the narrow circle of the town in which you live,cheap wow gold, then you live in a narrow circle of the town in which you live, then you live in a narrow circumscribed life. But if you are interested in what is going on in China, then you are living in China; if you are interested in the characters of a good novel, then you are living with those highly interesting people; if you listen intently to fine music, you are away from your immediate surroundings and living in a world of passion and imagination.

    To be or not to be-to live intensely and richly, or merely to exist, that depends on ourselves. Let us widen and intensify our relations. While we live, let us live!world of warcraft gold
  • The Escaped PrisonerMr Stapleton came to the Hall and met Sir Henry that same afternoon.The next morning he took us to the place where the evil Sir Hugo died.Then we had lunch at the House.Sir Henry clearly thought Miss Stapleton was very beautiful.His eyes followed her everywhere.He liked her very much,and I was sure that she felt the same about him.He spoke about her again and again as we walked home.After the first meeting,we met the Stapletons almost every day.

    After a short time it was clear that Sir Henry had fallen deeply in love with the beautiful Miss Stapleton.At first I thought that Stapleton would be very pleased if his sister mar ried Sir Henry.However,I soon realized that he did not want their friendship to grow into love.He did everything he could to make sure that they were never alone.On one or two occa sions they did manage to meet alone,but Stapleton followed them and was not pleased to see them together.
    wow power leveling
    I soon met another neighbour of Sir Henry's.His name was Mr Frankland,and he lived about four miles to the south of the Hall.He was an old man with a red face and white hair.He had two hobbies.The first was arguing.He argued with everybody.The second hobby was studying the stars.For this he had a very big telescope.For several days he had been watching the moor through the telescope.He wanted to find Selden,the escaped murderer.Nobody had seen the prisoner for a fortnight,and we all thought that he had probably left the moor.

    A few nights later I was woken by a noise at about two in the morning.I heard someone walking softly outside my door.I got up,opened the door and looked out.I saw Barrymore moving carefully and quietly away from me.I followed him,as quietly as I could.He went into one of the empty bedrooms and left the door open.I went quietly up to the door and looked in side.

    Barrymore was standing at the window.He was holding a light in his hand and looking out onto the moor.He stood without moving for a few minutes and then he put out the light.

    I went quickly back to my room.A few minutes later I heard Barrymore go softly by.

    The next morning I told Sir Henry what I had seen.

    'We must follow him and find out what he is doing,'said Sir Henry.'He won't hear us if we move carefully.',wedding dresses,

    That night we sat in Sir Henry's room and waited.At about three o'clock in the morning we heard the sound of footsteps outside the bedroom.We looked out and saw Barrymore.We followed him as quietly as we could.He went into the same room as before.We reached the door and looked in.There was Barrymore,with the light in his hand,looking out across the moor,exactly as I had seen him on the night before.

    Sir Henry walked into the room and said:'What are you do ing here,Barrymore?'

    Barrymore turned round quickly,surprise and horror on his face.

    'Nothing,Sir,'he said.The shadows on the wall from his light were jumping up and down as his hand shook.'It was the window,sir.I go round at night to see that they are closed,and this one wasn't shut.'

    'Come now,Barrymore,'said Sir Henry.'No lies.What were you doing with that light?You were holding it up to the window.'
    wedding dresses,
    I suddenly had an idea.'I think he was sending a message,' I said.'Let's see if there's an answer from someone on the moor.'

    I held the light up to the window,and looked out into the darkness.Suddenly a light answered from the moor.

    'There it is,'I cried.I waved my light backwards and for wards across the window.The light on the moor answered by moving in the same way.

    'Now,Barrymore,who is your friend on the moor?What's going on?'

    'That's my business,'said Barrymore,'I won't tell you.'

    'Are you making some criminal plan against me?'Sir Henry said.
    wow gold
    'No,it's nothing against you,sir,'said a voice behind us.It was Mrs Barrymore.She had followed us and was standing at the door.'He's doing it for me.My unhappy brother is cold and hungry on the moor.We cannot let him die.Our light is to tell him that food is ready for him.His light shows us where to take it.'

    'Then your brother is?'began Sir Henry.

    'The escaped prisoner,sir.Selden,the murderer.He is my younger brother.He has done evil things,but to me he is still the little boy I loved and cared for.I had to help him.Every thing my husband has done has been for me.Please don't take his job from him.It's not his fault.'

    Sir Henry turned to Barrymore and said:
    wow power leveling,
    'I cannot blame you for helping your wife.Go to bed,and we'll talk about this in the morning.'

    The Barrymores left us.

    'The murderer is waiting out there by that light,' said Sir Henry.'He's a danger to everyone.I'm going to catch him.If you want to come with me,Watson,fetch your revolver and let's go.'

    We left the Hall immediately.

    'We must surprise him and catch him.'said Sir Henry.'He's a dangerous man.Now,Watson,what would Holmes say about this?Do you remember what the old papers said? They said the Devil does his work when the world is dark.'

    The Escaped Prisoner