Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
See the below code.
What is the meaning of http in that.
I understand that it is namespace but what does mean by http there though it is not a web request?

XML
<Window x:Class="WindowsControlInWPF.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="576" Width="768" 
    
   <Grid>
   </Grid>
 </Window>
Posted
Updated 30-Dec-10 23:58pm
v4

It is nothing but XmlNamespace. This namespace can be anything, but as per Xml noms (I believe), xml namespace is define like that. It is useful when you write Xsl (Stylesheet) for Xml.

It is like importing namespace in Xaml.

It is common for all Xml (Xaml is next version of Xml).

Mark it as answer if it is helpful
 
Share this answer
 
v3
Comments
Pritesh Aryan 31-Dec-10 5:18am    
ya it is namespace you are right.
but why using http?
Pritesh Aryan 31-Dec-10 5:21am    
generally http used in URL or WebRequest. use of http here is looking some what awkward... doesn't it?
Venkatesh Mookkan 31-Dec-10 5:22am    
Updated the answer
Pritesh Aryan 31-Dec-10 5:24am    
ya but steel not satisfied....
Thanks for replying and interested in question...
hi,

Xaml is nothing more than XML.

What you are refering to is called a namespace URI, it is not used by the xml parser, it is just a identifier.

have a look at this website it will explain you how xml works:
http://www.w3schools.com/xml/xml_namespaces.asp[^]

Valery.
 
Share this answer
 
Comments
Pritesh Aryan 31-Dec-10 5:30am    
ya helpful link........
Sergey Alexandrovich Kryukov 31-Dec-10 11:22am    
The namespace URI can be used by "XML Processor". For example, Web Browser can read this namespace and figure out the version of HTML/XHTML and process HTML respectfully. And so does Visual Studio: try to change "http://schemas.microsoft.com/winfx/2006/xaml/presentation" to "http://schemas.microsoft.com/winfx/2006/xaml/presentation--xxx" -- it will not compile!

A namespace key prefix (this is, for example "x" "in xmlns:x"): it can be anything. If you replace "x" with anything else consistently -- from "xmlns:x" and everwhere from "x:" -- you will come to exact same code if new symbol is unique.
Some background:

The string started from "http:" in your sample is the namespace; and the "xmlns:x" introduce "x" as the associated keyword prefix you use to refer to the namespace throughout the XML code. The prefix itself can be anything (please see my comment to Valery's answer).

Name spaces is the way to introduce XML tags which can be world-unique (because URL can be world-unique and represent your organization and technology).

For XAML, this is the way to refer framework elements from different .NET name spaces, so there is mapping from .NET name spaces onto XML name spaces. Microsoft uses its own naming schema.

Try the following: choose some symbol unique to your current XAML, for example "MyNameSpace", go to XAML document tag (top-level) where attributes are and try to type the attribute: xmlns:MyNameSpace=""

When you do it, VS UI will give you a choice of available name spaces you can put in your XAML. For example, you can use xmlns:system="clr-namespace:System;assembly=mscorlib" which maps .NET System onto XAML. This way, you can further use something like this:

XML
<Window.Resources>
        <ResourceDictionary>
            <system:Double x:Key="SplitterSize">6</system:Double>
    </Window.Resources>
...


Importantly, this is also a way to insert your own control (framework element or whatever) in XAML. You develop you custom control code using some of your project name spaces, go to XAML and try to write a name space as I described above -- VS will show your namespace with your control; and you use it in your XAML.
 
Share this answer
 
v4
Comments
Espen Harlinn 28-Feb-11 15:40pm    
Right, my 5
Sergey Alexandrovich Kryukov 1-Mar-11 3:55am    
Thank you.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900