namespaces

Should the folders in a solution match the namespace?

Should the folders in a solution match the namespace? In one of my teams projects, we have a class library that has many sub-folders in the project. Project Name and Namespace: MyCompany.Project.Section Within this project, there are several folders that match the namespace section: - Folder Vehicles has classes in the MyCompany.Proje...

XPATHS and Default Namespaces

What is the story behind XPATH and support for namespaces? Did XPATH as a specification precede namespaces? If I have a document where elements have been given a default namespace: <foo xmlns="uri" /> It appears as though some of the XPATH processor libraries won't recognize //foo because of the namespace whereas others w...

Namespace/solution structure

I apologize for asking such a generalized question, but it's something that can prove challenging for me. My team is about to embark on a large project that will hopefully drag together all of the random one-off codebases that have evolved through the years. Given that this project will cover standardizing logical entities across the com...

Is there a "concise" way to do namespacing in JavaScript?

I've frequently encountered sites that put all of their javascript inside a "namespace" structure along the lines of namespaces = { com : { example: { example.com's data} } But setting this up safely with respect to other namespaced frameworks seems to require a relatively hefty amount of code (defined as > 2 lines). I was wondering ...

Why does VS 2005 keep giving me the "'x' is ambiguous in the namespace 'y'" error?

Bounty: I will send $5 via paypal for an answer that fixes this problem for me. I'm not sure what VS setting I've changed or if it's a web.config setting or what, but I keep getting this error in the error list and yet all solutions build fine. Here are some examples: Error 5 'CompilerGlobalScopeAttribute' is ambiguous in the namesp...

How to provide namespaces in JavaScript with instanced objects

I've got a JavaScript "object", built this way: function foo() { this.length = 0; } foo.prototype.getLength = function() { return this.length; } ... I know how to emulate namespaces with singleton JavaScript objects, but what is the best way to "namepace" an object such as that above that will intanced? I know that several...

XSL Dynamic Element Names

I want to transform an XML document. The source XML looks like this: <svc:ElementList> <svc:Element> <Year>2007</Year> </svc:Element> <svc:Element> <Year>2006</Year> </svc:Element> <svc:Element> <Year>2005</Year> </svc:Element> </svc:ElementList> I want to turn that into: <ElementList> ...

Namespace with Context.Handler and Server.Transfer?

What .NET namespace or class includes both Context.Handler and Server.Transfer? I think one may include both and my hunt on MSDN returned null. Thank you. ...

XML namespaces and attributes

I'm trying to understand how namespaces work in XML. When I have an element like foo:bar, the attributes will often not have namespaces on them. But sometimes they will. Are the attribute in the namespace of the element, even when the default namespace has been declared? Looking over the xsd for xhtml it seems the attributes are part of ...

How do you properly use namespaces in C++?

I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++. How do you use namespaces in C++? Do you create a single namespace for the entire application, or do yo...

Do namespaces propagate to children in XElement objects?

If I have an XElement that has child elements, and if I remove a child element from the parent, removing all references between the two, will the child XElement have the same namespaces as the parent? In other words, if I have the following XML: <parent xmlns:foo="abc"> <foo:child /> </parent> and I remove the child element, will...

.NET namespaces

My background is primarily as a Java Developer, but lately I have been doing some work in .NET. So I have been trying to do some simple projects at home to get better at working with .NET. I have been able to transfer much of my Java experience into working with .NET (specifically C#), but the only thing that has really perplexed me is n...

How do you resolve .Net namespace conflicts with the 'using' keyword ?

Here's the problem, you include multiple assemblies and add 'using namespaceX' at the top of your code file. Now you want to create a class or use a symbol which is defined in multiple namespaces, e.g. System.Windows.Controls.Image & System.Drawing.Image Now unless you use the fully qualified name, there will be a crib/build error due ...

Is there any way to get rid of the long list of usings at the top of my .cs files?

Simple question - As I get more and more namespaces in my solution, the list of using statements at the top of my files grows longer and longer. This is especially the case in my unit tests where for each component that might be called I need to include the using for the interface, the IoC container, and the concrete type. With upward ...

How can I get Axis 1.4 to not generate several prefixes for the same XML namespace?

I am receiving SOAP requests from a client that uses the Axis 1.4 libraries. The requests have the following form: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; <soa...

Setting the namespace of a WinForms UserControl in VB.NET

How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls? Edit due to camainc's answer: I also have a constraint that I have to have all the code in a single project. Edit to finalise question: As I suspected it isn't possible to do what I required so ca...

missing WMI namespace on Vista/Server 2008

What is equivalent to the root\CIMV2\Applications\MicrosoftIE namespace on Vista/Server 2008? The root\cimv2\Applications\MicrosoftIE namespace dates back to at least Internet Explorer 5.00.2920.0000, which happens to be the version of Internet Explorer that shipped with Windows 2000, but it looks like it is removed from Vista/Server 20...

How do I add a namespace reference to a SOAP response with Apache Axis2 and WSDL2Java

I'm looking at the SOAP output from a web service I'm developing, and I noticed something curious: <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt; <soapenv:Body> <ns1:CreateEntityTypesResponse xmlns:ns1="http://somedomain.com/wsinterface"&gt; <newKeys> <value>1234</value> ...

How do I get an attribute value when using XSLT with unknown namespace?

I am receiving a 3rd party feed of which I cannot be certain of the namespace so I am currently having to use the local-name() function in my XLST to get the element values. However I need to get an attribute from one such element and I don't know how to do this when the namespaces are unknown (hence need for local-name() function). N.B...

Getting all types in a namespace via reflection

How to get all the classes in a namespace through reflection in C# ...