namespaces

Writing an XML schema that allows qualified attributes from other namespaces

Is there a way to create an XSD that allows an attribute from a different namespace, but only if it's qualified? An example of an XML file that would be valid according to the schema is <d:document dx:size="a5" xmlns:d="http://example.com/documents" xmlns:dx="http://example.com/document-extensions"/&gt; The schema should enfor...

How to find the function name of namespaced constructors in javascript?

For example, compare these two: function Person(name) { this.name = name; } var john = new Person('John'); console.log(john.constructor); // outputs: Person(name) var MyJSLib = { Person : function (name) { this.name = name; } } var john2 = new MyJSLib.Person('John'); console.log(john2.constructor); // outputs: function() The fi...

Use system namespaces for class libraries: good or bad

Hi, Is it a good idea to use "system namespaces" in my class libraries? Sample: namespace System.Web { public static class RequestExtensions { public static bool IsPost(this HttpRequest r) { return string.Compare(r.HttpMethod, "POST", StringComparison.OrdinalIgnoreCase) == 0; } } } The advantage...

C# class/namespace Access

Hello, I asked this question to multiple people and until now I do not have an answer. ASP.NET C# Project tree (files and folders): > (ROOT) > > Class MyAccess (namespace myproject.core) > > (Directory John) ------> Class MyJohn (namespace myproject.core.John) ------> Class JohnSecret (namespace myproject.core.John) --...

problem with xslt and namespaces

I have a C# class that is serialized like this: <oadResults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.tyr.org.uk/standards" > <Link>http://www.tyr.org.uk//290/Data.zip&lt;/Link&gt; <ID>3540</ID> </oadResults> And I have a XSLT file: <xsl:stylesheet ...

Intellij 7.0.3 jsp tag namespace

I am declaring a namespace and binding it in a jsp file. i then include this JSP file in other files. however, the JSP file that contains this include complains that the namespace is not bound. Is there a way I can get intellij to intelligently understand that there is a file that is included and the namespace is bound in that file? ...

why can't I declare a namespace and a method in a do using Clojure

I try to write a macro in clojure that sets up a namespace and automatically adds a few methods to it. My macro wasn't working and I tracked it down to a do statement. It is not possible to declare a new namespace in a do and immediately afterwards declare a method in that namespace. Why? This does not work: (ns xyz) (do (ns abc) (...

Debugging data in 'anynomous namespaces' (C++)

Recently, I got a crash dump file from a customer. I could track the problem down to a class that could contain incorrect data, but I only got a void-pointer to the class, not a real pointer (void-pointer came from a window-property, therefore it was a void-pointer). Unfortunately, the class to which I wanted to cast the pointer to, was...

Clear Unwanted Namespaces with LibXML-Ruby

I would like to parse an Atom Feed and create an Atom-compliant cache of each Entry. The problem is that some feeds (this one for example) have many namespaces other than the Atom one. Is it possible to keep intact all Atom nodes and remove each node that belongs to another namespace? Something like this: valid_nodes = entry.find('a...

Problem with XSLT where source xml document uses default namespace

Have a source xml document that uses namespace containing prefixes and a default namespace. When I transform it using a XSLT doc, the resulting translated xml document is incorrect, that is, element data from the source xml document is missing. When I remove the "default namespace" from the source xml document, the transformation works...

XSLT with XML source that has a default namespace set to xmlns

I have an XML document with a default namespace indicated at the root. Something like this: <MyRoot xmlns="http://www.mysite.com"&gt; <MyChild1> <MyData>1234</MyData> </MyChild1> </MyRoot> The XSLT to parse the XML does not work as expected because of the default namespace, i.e. when I remove the namespace, everything w...

Howto make namespace attribute with groovy xml builder

How can i create an attribute with a namespace? To get the following output? <tns:catalogItem xsi:type="specialItem" /> This is how i do it yet: catalogItem( type:"specialItem"); But this generates the attribute without namespace, so its invalid <tns:catalogItem type="tns:specialItem" /> so i'm searching for something like this ...

What's the rationale behind the Qt way of naming classes?

I am wondering why Qt uses Q before every class name rather than putting everything in a namespace. Is there any particular reason, such as making the names easy to search for, or is it just about brand names? ...

Autoload with namespaces in PHP 5.3?

How do you use _autoload in PHP 5.3 with namespaces? I have a main autoload function in a namespace separate from my script. I'm also calling a class with a different namespace. (It's not surprising, but) It's not finding the autoload function. Do I have to recreate the autoload function for each namespace? That seems suboptimal. Thanks...

C# Namespace/class alias in Visual Studio Html Source mode

Is there any way to create a Namespace alias in a .aspx file (not code-behind .aspx.cs). For example... in a code-behind file an alias can be created as follows: using MyPanel = System.Web.UI.WebControls.Panel; In html source mode (Visual Studio) a Namespace can be imported as follows: <%@ Import Namespace="System.Web.UI.WebControls...

XML namespace in ASP.net MVC, C#

I'm trying to get an XML file generated using a namespace as such: <namespace:Example1> <namespace:Part1>Value1</namespace:Part1> </namespace:Example1> I've tried using [XmlAttribute(Namespace = "namespace")] public string Namespace { get; set; } but I'm clearly missing something. The structure I've used is [XmlRoot("...

Bulk Move ASP.NET Pages Into A New Namespace?

I have an C# ASP.NET Web Application Project where all the pages are in the global/default/top-level namespace. (I have no explicit namespace declarations. And when I look at my compiled web application's DLL in Red Gate's .NET Reflector, I can verify that all the classes are in the top-level .NET namespace.) Is there any good, automated...

Why does namespace after method call changes?

Hello, I'm creating a class, but having some trouble with the namespacing in python. You can see the code below, and it mostly works ok, but after the call to guiFrame._stateMachine() the time module is somehow not defined anymore. If I re-import the time module in _stateMachine() it works. But why is the time module not in the namesp...

Is there a shorter way to forward declare a class in a namespace?

I can forward declare a function in a namespace by doing this: void myNamespace::doThing(); which is equivalent to: namespace myNamespace { void doThing(); } To forward declare a class in a namespace: namespace myNamespace { class myClass; } Is there a shorter way to do this? I was thinking something along the lines of: cl...

what is the exact usage of xmlns in xml, and html

Does any one know what is the exact usage of xmlns in HTML, XML files? Edit: Why do we need this namespace? What is its usage? ...