Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3

Thread: XML namespaces

  1. #1
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I'm attempting to create a valid XHTML document that has custom tags. To do that, I figured I'd create an XHTML 1.0 Strict document, but put my tags in a custom namespace.

    I ended up with:
    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdf="http://www.webdesignforums.net/" xml:lang="en">
        <head>
            <title>Hello, world!</title>
        </head>
        <body>
            <p>
                Contents of variable $hello_world:
                <wdf:variable name="hello_world" />
            </p>
        </body>
    </html>
    ...but <oXygen/>, an XML editor I'm using, doesn't think it's valid because the XHTML 1.0 Strict doctype doesn't understand what "xmlns:wdf" is, and therefore doesn't recognize the entire "wdf" namespace and the <wdf:variable /> tag. Removing the doctype works, but loses the advantage of enforcing proper structure for XHTML.

    Ideas on what to do, other than removing the DTD or duplicating the W3C DTD to add my own exceptions? What's the proper way of modifying an XML document with a DTD to add a custom namespace and tags?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    I want to say you can have multiple doctype declarations in one file... But I may be completely wrong.

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Not allowed.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:53 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com