namespaces

How do I create an array of namespaces?

How can I create an array of namespaces? And because it seems like a long shot, if this is impossible, is there something similar to a namespace that can be made into an array? The namespace, if it helps, contains these variables: const int maxx=// depends on the particular namespace // I need an array to go through eac...

What should I do if I have the same class name on different namespaces?

I'm working on a project and I came to the following naming problem. I'd like to implement the factory pattern but I don't know the best class namings to use (i'm changing from one to the other and it's quite time-consuming :S). I usually go for namespaces to separate groups of classes, but my problem is with this specific piece of cod...

What is the difference between a namespace, a class, an object and an instance?

I'm reading Heads First C# (it's very interesting and user-friendly), but I wondered if anyone had a useful metaphor for describing how Name spaces, Classes, methods, properties, etc. all 'fit together'? Is Class a Parent and a Method a child, etc. Or is it more complicated? Could a Name Space be a house, and a Class be a room (Bathroo...

PHP Class Name Conflict

I'm attempting to mix a PHP REST framework (Recess) with an webapp building framework (VCL4PHP), they unfortunately like to name their classes the same. Cache, Application (probably others, but I gave up at Application). Are there namespaces in PHP or any way I can get around this without rewriting one or the other frameworks or am I S...

How can I prevent these redundant namespaces from an XSLT stylesheet?

When using an XSLT stylesheet to transform an XML file which contains embedded XHTML (using namespaces) into pure XHTML, I'm left with redundant namespace definitions on the elements which were originally XHTML. Simple test case: XML: <?xml version="1.0" encoding="utf-8" ?> <?xml-stylesheet type="text/xml" href="fbb.xsl"?> <foo xmlns=...

Delphi - Invalid namespace URI in IXMLNode

I am trying to parse a response from a SOAP web service, but part of the data has an invalid xmlns element and I think it is causing me no end of trouble. The part of the XML that I am working with is as follows. <soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; <ResponseData xmlns="http://www.example.com/WebSer...

XSL Transform Across Namespaces

I have XML that looks something like this: <Root xmlns="http://widgetspecA.com/ns"&gt; ...any... <WidgetBox> <A/> <B/> <SmallWidget> <!-- minOccurs='0' --> ...any... </SmallWidget> <Widgets> <!-- minOccurs='0' --> ...any... </Widgets> ...any... </WidgetBox> ...any... </Root> and I want t...

The PHP6 Namespace operator... what's the big deal?

Can someone explain to me what exactly is so bad about using the backslash as the namespace operator for PHP6? It's impossible to read any discussion about PHP6 these days without someone making some scoffing remark about it. One StackOverflower even said that he gave up PHP because of it. Yes I know that backslash has special meaning a...

What should go into a top level namespace?

What should go into the top level namespace? For example, if I have MyAPI.WebLogic, MyAPI.Compression, etc. If I put classes into the top level namespace, am I violating the principle of encapsulation? ...

c# Where can I lookup Microsoft Namespace names?

I'm using a MS namespace but Visual Studio is telling me I don't have a reference to it. Is there a place you can go to and lookup namespaces? Thanks ...

What's the best way to change the namespace of a highly referenced class?

I am attempting to move a highly referenced class from one namespace to another. Simply moving the file into the new project which has a different root namespace results in over 1100 errors throughout my solution. Some references to the class involve fully qualified namescape referencing and others involve the importing of the namespace...

jQuery XML parsing with namespaces

I'm new to jQuery and would like to parse an xml document. I'm able to parse regular XML with the default namespaces but with xml such as: <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"> <s:Schema id="Ro...

XSL: Avoid exporting namespace defintions to resulting XML documents.

I'd like to take data from some XML files and transform them into a new XML document. However, I do not want the definition of a namespace in the XSLT to occur in the result document. In other words: source: <Namespace:Root xmlns:Namespace="http://www.something.com"&gt; stylesheet: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:...

static class data vs. anonymous namespaces in C++

I occasionally have classes with private static data members. I'm currently debating if I should replace these with static variables in an unnamed namespace in the implementation file. Other that not being able to use these variables in inline methods, are there any other drawbacks? The advantage that I see is that is hides them compl...

Xpath and XmlNameSpace

I have the following XML <?xml version="1.0"?> <FileHeader xmlns="urn:schemas-ncr-com:ECPIX:CXF:FileStructure:020001" VersionNumber="020001" TestFileIndicator="P" CreationDate="13012009" CreationTime="172852" FileID="0000000001" > <Item ItemSeqNo="09011340010009" PayorBankRoutNo="00704524" Amount="3980...

How to set a default namespace for classes when there are two simlar classes in different namespaces

Ok, so since going to version 2.5 Nunit is causing me all sorts of problems because they introduced the static class Is into the nunit.framework namespace. It would be well and good if Rhino.Mocks and a few other frameworks did not also make use of an Is static class. So now if I upgrade to 2.5 most of my code that uses rhino mocks con...

Namespace prefix in C#

Hi, I can already do: using System.Windows.Forms; Button b; or: System.Windows.Forms.Button b; but I would like to do: using System.Windows; Forms.Button b; (because Button is ambiguous with another namespace, and typing System.Windows.Forms.Button is too long). However this gives me an error, how can I achieve this? Thanks ...

How to generate XML documents with namespaces in Python

I'm trying to generate an XML document with namespaces, currently with Python's xml.dom.minidom: import xml.dom.minidom doc = xml.dom.minidom.Document() el = doc.createElementNS('http://example.net/ns', 'el') doc.appendChild(el) print(doc.toprettyxml()) The namespace is saved (doc.childNodes[0].namespaceURI is 'http://example.net/ns')...

Loading files into variables in python

I am trying to write a small function that gets a variable name, check if it exists, and if not loads it from a file (using pickle) to the global namespace. I tried using this in a file: import cPickle # # Load if neccesary # def loadfile(variable, filename): if variable not in globals(): cmd = "%s = cPickle.load(file('%s'...

Remove Namespaces Prefix in Sandcastle

I have a large project with long namespaces, like CompanyName.Product.Component.Class Using Sandcastle to build the documentation for the namespaces, but those long namespaces really screw up the display of the contents pane in the final chm file. How can I get it to display just Component.Class in at least the Treeview panel? And...