XML namespaces

  • Hi,

    I'm completely lost with XML Namespace and elementFormDefault and attributeFormDefaut.

    xmlns is a default namespace? We give it a URI that points at W3C.Org page. That page contains the specification of XML - lots of text, examples etc. So why do we have to pass that exact URL?

    Then we can have two names spaces:

    xmlns:x1 = "blah1"

    xmlns:x2 = "blah2"

    I have two elements:

    x1 Element_name

    x2 Element_name

    I'm happy with the fact that these elements are different because they have different prefixes.

    When I supply targetNameSpace, let say targetNameSpace = "myTargetNameSpace"...what happens? What does it do to the 2 existing name spaces?

    Where do qualify and not to qualify come in?

    I have read W3C tutorials and the spec, but I'm still slightly lost in what's going on.

    Any help is appreciated!

    Thank you.

  • I'm pretty sure you can change the default namespace, but you'd have to play with it to be positive.

    Why don't you test it out and publish an article on your experiment? I'm sure a lot of people would love to see the results.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • See Jacob Sebastian's XML articles:

    XML Workshop X - Working with namespaces

    http://www.sqlservercentral.com/articles/XML/61333/

    XML Workshop XI - Default Namespaces

    http://www.sqlservercentral.com/articles/XML/61334/


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

  • They serve a similar purpose as namespaces in the .NET Framework, except the context is the XML markup.

    Namespaces allow the editor/development environment to show appropriate intellisense-like feedback.

    In WPF, there are some namespaces which are specifically looked for by the compiler/run-time (they are actually hard-coded within the .NET Framework).

    As you can see, the advantages are primarily for the developer(s), just like other namespaces.

    ______________

    Absolute Steal.com

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply