How XML is Useful in Web Development

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shalini Bhalla
    New Member
    • Dec 2007
    • 190

    How XML is Useful in Web Development

    Hi friends i have basic knowledge of xml coding but i am not able to relate it with live project , I want to know exactly how can xml can help me in my webdesigning , usually i use php for server side programming . What things are possible using xml or where and how i should use xml in my projects ?
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    XML is a good place to store some settings.

    With .Net based application, the settings are stored in a .config file, which is basically an xml file.

    things like connection string, any constant strings, user settings, etc can be stored as it acts as a central repository for that and can be changed withouth having to go inside the code.

    I even once created an online help document in xml, and use xsl to transform them to html, which meant that i could seperate design and data from each other completely and could change the style anytime i wanted.

    But in general XMl is a good place to store settings and other values which are used in the code

    Comment

    • Shalini Bhalla
      New Member
      • Dec 2007
      • 190

      #3
      how can i use it with php

      Comment

      • Shashi Sadasivan
        Recognized Expert Top Contributor
        • Aug 2007
        • 1435

        #4
        I havent used php,
        but even php would need connection strings

        maybe you can even store all the sql strings in it

        [CODE=xml]<configuratio n>
        <sql>
        <sqlString id="select_user " value="select * from users"/>
        <sqlString id="delete_user " value="delete from user where user_id = {0}"/>
        </sql>
        <connectionStri ngs>
        <connectionStri ng id="myDatabase " value="datasour ce=(local);user =admin;pwd=1234 "/>
        </connectionStrin gs>
        </configuration>[/CODE]

        {0} is a .Net specific place holder . I am not aware if php has an equivalent to it

        Comment

        Working...