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 2 of 2

Thread: Abt Namespaces

  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    Bangalore,India
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Abt Namespaces

    Hi All,
    Given below are two same file with diffrent way of implementing the namspaces. But when i view both its behaving diffrently.
    Can any one pls tell me y?

    <h:html xmlns:xdc="http://www.xml.com/books"
    xmlns:h="http://www.w3.org/HTML/1998/html4">
    <h:head><h:title>Book Review</h:title></h:head>
    <h:body>
    <xdc:bookreview>
    <xdc:title h:style="font-family: sans-serif;">
    XML: A Primer</xdc:title>
    <h:table>
    <h:tr align="center">
    <h:td>Author</h:td><h:td>Price</h:td>
    <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
    <h:tr align="left">
    <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
    <h:td><xdcrice>31.98</xdcrice></h:td>
    <h:td><xdcages>352</xdcages></h:td>
    <h:td><xdc:date>1998/01</xdc:date></h:td>
    </h:tr>
    </h:table>
    </xdc:bookreview>
    </h:body>
    </h:html>

    =====================================

    <html xmlns="http://www.w3.org/HTML/1998/html4"
    xmlns:xdc="http://www.xml.com/books">
    <head><title>Book Review</title></head>
    <body>
    <xdc:bookreview>
    <xdc:title>XML: A Primer</xdc:title>
    <table border=1>
    <tr align="center">
    <td>Author</td><td>Price</td>
    <td>Pages</td><td>Date</td></tr>
    <tr align="left">
    <td><xdc:author>Simon St. Laurent</xdc:author></td>
    <td><xdcrice>31.98</xdcrice></td>
    <td><xdcages>352</xdcages></td>
    <td><xdc:date>1998/01</xdc:date></td>
    </tr>
    </table>
    </xdc:bookreview>
    </body>
    </html>


    Thanks
    Anandraj.A.

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    HTML cannot coexist with XML. Use the XHTML namespace "http://www.w3.org/1999/xhtml" instead of "http://www.w3.org/HTML/1998/html4"

    Other than that, both documents should be indentical. The latter is what I would use though, since the page is primarily XHTML, and prefixing every element gets to be a pain.


  •  

    Posting Permissions

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