Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Copenhagen, Denmark
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Learning XML: Using data for simple calculations

    Hello everybody,

    I am trying to learn XML but I'm blocked after the first steps. I have an high-intermediate knowledge of HTML and CSS, but I am absolutely blank on PHP and Javascript, and I know that what I'm going to ask here is probably involving the latter.

    In any case, I succeeded in the simple steps of building a valid xml file, styling it with xls and displaying it correctly. Now I would like to play around a little bit more dinamically with the data stored in my XMLs.

    What I am aiming to do is to let the user select a record inside a specific XML file so that only the selected record would be displayed; then, what I'd like is to select another set of data and let the two set interact in a third result.
    Let's say that all the data contains nothing but numbers, I would like to select the first set of numbers, then the second set and thirdly display the result of a simple calculation (sum, subtraction, multiplication, fraction) between the data collected.

    I know this should be something fairly simple, but I have no clue on how to move in the direction I want, that's why I'm posting to ask for your help.
    Hope someone finds time to lend a hand,

    Thank you in advance,

    M. L.

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Location
    Copenhagen, Denmark
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your reply.
    I already went through both tutorials at W3Schools, and got a grasp on the various functions as well. But the problems for me remain all the same:
    How can I dynamically access those data? I can of course display the data I need beforehand, but what if I want to change dynamically the data displayed with data from a whole different .xml file or from a different record on the same xml?
    Moreover, how could I make simple calculations using the data stored within an XML? Do I have to use javascript? Or is there some other way?

    Thank you again.

    M. L.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •