Thread: regarding conditional statement in xml

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    90

    regarding conditional statement in xml

    hi all.
    iam using libxml for creating and editng my xml pages .
    now i have problem with conditional satement.
    is there any conditional statements in xml.
    if it is how can i use if statement

    actually my requirement is
    if i pass a=500 to my xml file
    it will check the conditions like this
    if (a>1 && a<250)
    a=1;
    else if(a>250 && a<=500)
    a=0;
    how can i write this in xml file
    thank u in adavancee
    sree

  2. #2
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    This is a C board, not a XML or HTML board. Try a search engine of your choice.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    90
    yah i know
    but libxml is purely in c
    so i asked my query here

  4. #4
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    If the LIb is coded in C doesn't mean that C programmers will know the syntax of your language is all I'm saying.

    I can understand the C code you posted, but I have no idea how to "translate" that into another language, dig?

    As far as I know you can't directly inject C code into XML or HTML. I could be wrong.

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    xml is a markup language, meaning it doesn't have flow control, just formatting. If you want to make decisions, consider scripting it, for instance, using Javascript.

    And yeah, this isn't really an xml/javascript board.

  6. #6
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    Quote Originally Posted by robwhit View Post
    xml is a markup language, meaning it doesn't have flow control, just formatting. If you want to make decisions, consider scripting it, for instance, using Javascript.

    And yeah, this isn't really an xml/javascript board.
    But xsl language does have flow control... and xsl file has xml structure and can be read by xml parser...
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Usefulness of the "else if" statement
    By gn17 in forum C Programming
    Replies: 7
    Last Post: 08-12-2007, 05:19 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. XML and data exchange
    By seexml in forum C Programming
    Replies: 0
    Last Post: 04-27-2006, 03:02 PM
  4. I need help as soon as possible.
    By hyrule in forum C++ Programming
    Replies: 7
    Last Post: 11-09-2005, 05:49 PM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 04:49 PM