XML NameSpaces Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AtulTiwari
    New Member
    • May 2007
    • 23

    XML NameSpaces Help

    i know that what is namespace in xml why it is used?
    but i don't know how it is used?

    in the below example i know that we are declaring a namespace(alias ) h and f for seprating the table tag but what is "room" and what the URI means
    i.e "<room xmlns:h="http://www.w3.org/TR/html4/" what it means?

    Can any one please explain the terms...

    <room xmlns:h="http://www.w3.org/TR/html4/"
    xmlns:f="http://www.w3schools.c om/furniture">

    <h:table>
    <h:tr>
    <h:td>Apples</h:td>
    </h:tr>
    </h:table>

    <f:table>
    <f:name>Afric an Coffee Table</f:name>
    <f:width>80</f:width>
    <f:length>120 </f:length>
    </f:table>
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    It looks like you have the room in the default namespace, and are declaring a namespace h, which points to http://www.w3.org/TR/html4/, an html namespace.

    I think it should probably be <f:room>, since you probably want the room in the furniture namespace.


    we use <h:table> to represent an html table.
    we use <f:table> to represent the furniture table.

    If we didn't have these namespaces, then if we saw an element table, which table would it be? html or furniture?

    Comment

    Working...