Search Results

Search found 763 results on 31 pages for 'namespaces'.

Page 7/31 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • private classes inside namespaces

    - by blacklion
    Is there a way to restrict access to a class from outside a namespace? What I want is to have a class that is only accessible to other classes inside the same namespace without having to put the namespace in it's own assembly. Is there a reason this is not possible in C#?

    Read the article

  • How can I handle an empty namespace with XDocument.XPathEvaluate?

    - by Kevin
    I'm trying to use XDocument and XPathEvaluate to get values from the woot.com feed. I'm handling other namespaces fine, but this example is giving me problems. <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0"> <channel> <category text="Comedy" xmlns="http://www.itunes.com/dtds/podcast-1.0.dtd"> </category> <!-- this is a problem node, notice 'xmlns=' --!> So I try this: XmlNamespaceManager man = new XmlNamespaceManager(nt); man.AddNamespace("ns", "http://www.w3.org/2000/xmlns/"); // i've also tried man.AddNamespace("ns", string.Empty); xDocument.Namespace = man; var val = xDocument.XPathEvaluate("/rss/channel/ns:category/@text", xdwn.Namespace); val is always null. I'm using ns: from the suggestion from VS 2010 XPath Navigator plugin. Any thoughts on how to handle this?

    Read the article

  • Should I worry about reigning in namespace number/length/scope?

    - by Jay
    I've recently reorganized a solution-in-progress from 24 projects to 4. To keep the copious files organized in the "main" project, things are in folders in folders in folders. I think I've preserved a logical, discoverable arrangement of the solution content. As a result, of course, I end up with namespaces like AppName.DataAccess.NHibernate.Fluent.Mappings. Is there any compelling reason that I should care about flattening out the namespace hierarchy when my project has a somewhat deeply nested folder structure? (I am not concerned about resolving or managing using directives; I let ReSharper do all the heavy lifting here.)

    Read the article

  • Namespace Autoload works under windows, but not on Linux

    - by EvilChookie
    I have the following php code: index.php <?php spl_autoload_extensions(".php"); spl_autoload_register(); use modules\standard as std; $handler = new std\handler(); $handler->delegate(); ?> modules\standard\handler.php <?php namespace modules\standard { class handler { function delegate(){ echo 'Hello from delegation!'; } } } ?> Under Windows 7, running WAMP, the code produces the message "Hello from Delegation!" however under Linux, I get the following: Fatal error: spl_autoload(): Class modules\standard\handler could not be loaded in /var/www/index.php on line 15 Windows is running PHP 5.3.0 under WAMP, and Linux is running the 5.3.2 dotdeb package under Ubuntu 9.10. Is this a configuration issue on my linux box, or just a difference in the way namespaces and autoloading is handled on the different operating systems

    Read the article

  • Difference between halo and mx namespace

    - by Andree
    Hi there ! As far as I know, the support for library://ns.adobe.com/flex/halo namespace has been dropped, and now we have to use library://ns.adobe.com/flex/mx instead (reference). Can someone provide if there's any difference between the two namespaces? I am just starting to learn Flex and this change make me confused. For example, if I have an <mx:Tree> tag in my mxml document, the compiler complains that <mx:Tree> could not be resolved to a component implementation. But if I change my mx namespace to use the old one instead (halo), it successfully compiled without error. Thanks. Andree Updated: By the way, I use Flex SDK command line compiler in Windows. mxmlc --version Version 4.0.0 build 10485

    Read the article

  • The type or namespace name 'Oledb' does not exist in the namespace 'System.Data' error on Web Servic

    - by Pankaj Kumar
    Hi everyone... i have a webservice that i want to test by typing the url in the address bar in the web browser localhost:1981/myProject/admin/autocomplete.asmx and when i do this it gives this compilation error CS0234: The type or namespace name 'Oledb' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) i know this is because we added this in our web.config <add namespace="System.Data.Oledb"/> <add namespace ="System.Data"/> in the namespaces section..... when i call this web service through ajax it works but if i try to test it it gives this error. Is there any way to prevent this?

    Read the article

  • JAXB appending unneeded namespace declarations to tags

    - by jb
    I'm implementing a homebrew subprotocol of XMPP, and i'm using combination of StAX and JAXB for parsing/marshalling mesages. And when I marshall a message I end up with loads of unneded namespace declarations: <ns2:auth xmlns:ns2="urn:ietf:params:xml:ns:ilf-auth" xmlns:ns4="ilf:iq:experiment:power" xmlns:ns3="ilf:iq:experiment:init" xmlns:ns5="ilf:iq:experiment:values" xmlns:ns6="ilf:iq:experiment:result" xmlns:ns7="ilf:iq:experiment:stop" xmlns:ns8="ilf:iq:experiment:end"> compton@ilf</ns2:auth> instead of: <ns:auth xmlns:ns="urn:ietf:params:xml:ns:ilf-auth>compton@ilf</ns:auth> Is there any way to turn that of? All these namespaces are used in different messages that get marshalled/unmarshalled by JAXB, but every message uses one namespace. PS. I am not an XML expert please dont rant me if I did some stupid mistake ;)

    Read the article

  • Strategy for developing namespaced and non-namespaced versions of same PHP code

    - by porneL
    I'm maintaining library written for PHP 5.2 and I'd like to create PHP 5.3-namespaced version of it. However, I'd also keep non-namespaced version up to date until PHP 5.3 becomes so old, that even Debian stable ships it ;) I've got rather clean code, about 80 classes following Project_Directory_Filename naming scheme (I'd change them to \Project\Directory\Filename of course) and only few functions and constants (also prefixed with project name). Question is: what's the best way to develop namespaced and non-namespaced versions in parallel? Should I just create fork in repository and keep merging changes between branches? Are there cases where backslash-sprinkled code becomes hard to merge? Should I write script that converts 5.2 version to 5.3 or vice-versa? Should I use PHP tokenizer? sed? C preprocessor? Is there a better way to use namespaces where available and keep backwards compatibility with older PHP?

    Read the article

  • Python namespace in between builtins and global?

    - by Paul
    Hello, As I understand it python has the following outermost namespaces: Builtin - This namespace is global across the entire interpreter and all scripts running within an interpreter instance. Globals - This namespace is global across a module, ie across a single file. I am looking for a namespace in between these two, where I can share a few variables declared within the main script to modules called by it. For example, script.py: import Log from Log import foo from foo log = Log() foo() foo.py: def foo(): log.Log('test') # I want this to refer to the callers log object I want to be able to call script.py multiple times and in each case, expose the module level log object to the foo method. Any ideas if this is possible? It won't be too painful to pass down the log object, but I am working with a large chunk of code that has been ported from Javascript. I also understand that this places constraints on the caller of foo to expose its log object. Thanks, Paul

    Read the article

  • DOM: how to import nodes and give them different namespace prefix

    - by thomasrutter
    I'm familiar with the DOMDocument::importNode method for importing a tree of nodes from some other document element. However, what I was wondering is if I can automatically change the namespace prefix on a tree of nodes as I import them, that is, specify a new prefix for all nodes of that namespace. Say the nodes, in their existing document, all have names like "name", "identity", and so on. When importing them into my new document they will be alongside other namespaces, so I'd like them to appear as "nicnames:name", "nicnames:identity" and so on. I'd like to be able to change this prefix programmatically so that in another context I may be able to import them as, for instance, "myprefix:name", "myprefix:identity" depending on the document they're imported into. Can anyone help me understand how to do this? Thanks

    Read the article

  • How can I set the Root Namespace property correctly in a C++/CLI application?

    - by Matthew Bowen
    I have a C++/CLI application in Visual Studio 2008 whose namespace follows the .NET guideline of CompanyName.TechnologyName[.Feature][.Design]. The problem is that there seems to be no way to set a multi-level namespace in the project's Root Namespace property. I have tried both CompanyName.TechnologyName and CompanyName::TechnologyName. It seems that I cannot have a Form control inside a namespace that is not the root namespace as this causes the resources it uses to not be found, thus to me it seems impossible to follow their guideline and be consistent with my C# applications. Is there a way to set this property to use multi-leveled namespaces or am I forced to use a root namespace that is simply one-level? Or is there a solution that I am overlooking? Any help would be appreciated. Thanks

    Read the article

  • Global Import Aliasing in .NET

    - by Josh Stodola
    Using import aliasing in a single class, we can reference class library namespaces by assigning our own custom alias like this: Imports Db = Company.Lib.Data.Objects And then we are able to reference the classes inside of Company.Lib.Data.Objects by using the Db alias that we assigned. Is it possible to do this at the global level so that the alias is applied to the entire solution instead of the given file? Currently, we are working with web applications, so I was hoping we could add something to web.config, but I am also interested in whether or not this is possible with windows forms, console apps, and/or class libraries.

    Read the article

  • Should every class have its own namespace?

    - by thehouse
    Something that has been troubling me for a while: The current wisdom is that types should be kept in a namespace that only contains functions which are part of the type's non-member interface (see C++ Coding Standards Sutter and Alexandrescu or here) to prevent ADL pulling in unrelated definitions. Does this imply that all classes must have a namespace of their own? If we assume that a class may be augmented in the future by the addition of non-member functions, then it can never be safe to put two types in the same namespace as either one of them may introduce non-member functions that could interfere with the other. The reason I ask is that namespaces are becoming cumbersome for me. I'm writing a header-only library and I find myself using classes names such as project::component::class_name::class_name. Their implementations call helper functions but as these can't be in the same namespace they also have to be fully qualified!

    Read the article

  • Wrong route generation using namespace

    - by Plume
    Hi people! I am building an administration space in my web application. To do this, I am using namespaces but even if the rake generated routes are ok, when i follow the root of my admin space I get an error: Routing Error No route matches "/guru" My routes.rb : Baies::Application.routes.draw do |map| resources :fights resources :actions resources :users namespace :guru do root :to => "guru#index" resources :users end root :to => "public#index" end My arbo: . `-- app `-- controllers |-- actions_controller.rb |-- application_controller.rb |-- fights_controller.rb |-- guru | |-- guru_controller.rb | `-- users_controller.rb |-- public_controller.rb `-- users_controller.rb For information, the routes /guru/users works :) Thanks for help! @tchaOo°

    Read the article

  • Why so many individual System.Web.* DLLs?

    - by toasteroven
    I've been thinking about ways to refactor a fairly expansive class/utility library I have, and one thing I think I want to do is split off any higher-level helper utilities that introduce new dependencies. I read some previous questions here, and one that I particularly noticed was a comment about how Microsoft freely uses namespaces across DLLs. The example given was System.Web - it's in the base framework, but there's also a System.Web.dll that adds more functionality to the namespace if you want it. I also noticed several other System.Web.* DLLs available, and I was wondering if there's a reason why they wouldn't be combined into a single DLL. Could it be that they have their own individual dependencies and Microsoft (like me) wanted to separate assemblies along those lines? Or is it for easier maintenance? Something else entirely?

    Read the article

  • SubSonic 3.0 two different Databases namespace Issue

    - by Roswell
    My question is simple, I have two databases with the same scehema, one is live database say DLive and other one is testbed say DTestBed.... However, I want to use the same database namespace for both database. How can I achieve that without changing namespace in my code all over? Sometimes you need to do builds for live and testbeds in the same day ! Its really hard to change big project namespaces everytime you build. How can I just change the webconfig connection string and get it done? Thanks,

    Read the article

  • Global Import/using Aliasing in .NET

    - by Josh Stodola
    Using import aliasing in a single class, we can reference class library namespaces by assigning our own custom alias like this: ' VB Imports Db = Company.Lib.Data.Objects // C# using Db = Company.Lib.Data.Objects; And then we are able to reference the classes inside of Company.Lib.Data.Objects by using the Db alias that we assigned. Is it possible to do this at the global level so that the alias is applied to the entire solution instead of the given file? Currently, we are working with web applications, so I was hoping we could add something to web.config, but I am also interested in whether or not this is possible with windows forms, console apps, and/or class libraries.

    Read the article

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

    - by olliej
    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 whether anyone knows of a concise way to do this? and whether there's a relatively standard/consistent way to structure it? eg. is the "com" namespace directly attached to the global object, or is it attached through a namespace object? [Edit: whoops, obviously {com = { ... } } wouldn't accomplish anything close to what i intended, thanks to Shog9 for pointing that out. :D]

    Read the article

  • extracting RDL data using LINQ

    - by BobC
    I'm working with some SQL Report definition files (RDLs), using LINQ to extract component query statements for validation. I'm trying to extract the <DataSet> elements from under the <DataSets> element. I seem to be getting hung up with one of the elements under <DataSet><Fields><Field> which has a namespace qualifier <rd:TypeName> I've been using LINQ to XML for other parts of the files where there is no namespace qualifiers with no trouble, by specifying a default namespace. The RDL specifies two namespaces: xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"> When I try to get the <DataSets> element, however, I get the following error: System.Xml.XmlException - The ':' character, hexadecimal value 0x3A, cannot be included in a name. I know it has to do with the namespace qualifier (rd:) in one of the child elements, but I'm having difficulty getting a LINQ expression that works. Any help would be appreciated. Thanks!

    Read the article

  • Getting "<kml:..." everywhere, updating a Kml file

    - by Rafe Lavelle
    I'm reading in a Kml file, changing the placemarks' names, and saving it again. var KmlFile = XDocument.Load("C:\\Inetpub\\wwwroot\\GeotagService\\Kml\\Photographs.kml"); XNamespace KmlNamespace = "http://www.opengis.net/kml/2.2"; // find the Placemarks in the Photos folder IEnumerable<XElement> Placemarks = KmlFile.Element(KmlNamespace + "kml").Element(KmlNamespace + "Document").Element(KmlNamespace + "Folder").Elements(KmlNamespace + "Placemark"); foreach (XElement p in Placemarks){ p.Element(KmlNamespace + "name").Value = "testing"; } KmlFile.Save("C:\\Inetpub\\wwwroot\\GeotagService\\Kml\\Photographs.kml"); When I save it however, every element is prefixed with <kml:, like this: <kml:Folder> <kml:name>Photos</kml:name> <kml:open>1</kml:open> <kml:Placemark> <kml:name>testing</kml:name> <kml:LookAt> <kml:longitude>-10.02717694938161</kml:longitude> <kml:latitude>53.48672543547379</kml:latitude> <kml:altitude>0</kml:altitude> </kml:LookAt> <kml:styleUrl>#msn_ylw-pushpin1</kml:styleUrl> <kml:Point> <kml:coordinates>-10.02867619360582,53.48651240326751,0</kml:coordinates> </kml:Point> </kml:Placemark>... Tomalak's comment on this question about blank xmlns gives me a clue that it might be inconsistencies between the namespaces of the document and the elements, but I can't see how I'm doing that. Anyone know?

    Read the article

  • Search XDocument with LINQ with out knowing the Namespace

    - by BarDev
    Is there a way to search a XDocument without knowing the Namespace. I have a process that logs all soap requests and encrypts the sensitive data. I want to find any elements based on name. Something like, give me all elements where the name is CreditCard. I don't care what the namespace is. My problem seems to be with LINQ and requiring a xml namespace. I have other processes that retrieve values from XML, but I know the namespace for these other process. XDocument xDocument = XDocument.Load(@"C:\temp\Packet.xml"); XNamespace xNamespace = "http://CompanyName.AppName.Service.Contracts"; var elements = xDocument.Root.DescendantsAndSelf().Elements().Where(d = d.Name == xNamespace + "CreditCardNumber"); But what I really want, is to have the ability to search xml without knowing about namespaces, something like this: XDocument xDocument = XDocument.Load(@"C:\temp\Packet.xml"); var elements = xDocument.Root.DescendantsAndSelf().Elements().Where(d = d.Name == "CreditCardNumber") But of course this will not work be cause I do no have a namespace. BarDev

    Read the article

  • Parsing SOAP XML in Oracle

    - by user258587
    Hi I am new to Oracle and I am working on something that needs to parse a SOAP request and save the address to DB Tables. I am using the XML parser in Oracle (XMLType) with XPath but am struggling since I can't figure out the way to parse the SOAP request because it has multiple namespaces. Could anyone give me an example? Thanks in advance!!! edit It would be a typical SOAP request similar to the one below. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.service.****.com"> <soapenv:Header /> <soapenv:Body> <soap:UpdateElem> <soap:request> <soap:att1>123456789</soap:att1> <soap:att2 xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> <soap:att3>L</soap:att3> ..... </soap:request> </soap:UpdateElem> </soapenv:Body> </soapenv:Envelope> I need to retrieve parameters att1, att2... and save them in to a DB table.

    Read the article

  • NAMESPACE_SEPARATOR constant

    - by ts
    Hello, Having namespaces in PHP is great. Having '\' as namespace separator is a little bit ... awkward (but if there is someone who thinks that is cool & sexy, I am adding tag "rant" to this post. ;) . So, here goes the question: Are you using in your code NAMESPACE_SEPARATOR constant? As in code below: <?php if (!\defined('NAMESPACE_SEPARATOR') { \define('NAMESPACE_SEPARATOR', '\\'); } // if Pros: consistent with DIRECTORY_SEPARATOR (which all of us are using ;) no mess with escaping (think of '\Foo\Bar' but '\\' . Foo' . '\\' . 'Bar') more readable (IMHO) which gives us in effect an opportunity to write good, namespace-aware autoloaders can resist another change if something scary happens (as with ol'good '::' from PHP 6 alpha) can hide uniquess of '\' as namespace operator in programming language land from strangers ;) Cons: "The reason for DIRECTORY_SEPARATOR is that the value is platform dependent, the namespace separator isn't." (as stated in http://bugs.php.net/bug.php?id=43046) 19 characters instead of 1 ( \ ) or 4 ('\\') There are places where you can't use this (full qualified class names as default class variables) ie: class A { protected $sDefaultReporterClass = '\My\Namespace\DefaultReporter'; } So, what are you thinking ?

    Read the article

  • Extension methods conflict

    - by Yochai Timmer
    Lets say I have 2 extension methods to string, in 2 different namespaces: namespace test1 { public static class MyExtensions { public static int TestMethod(this String str) { return 1; } } } namespace test2 { public static class MyExtensions2 { public static int TestMethod(this String str) { return 2; } } } These methods are just for example, they don't really do anything. Now lets consider this piece of code: using System; using test1; using test2; namespace blah { public static class Blah { public Blah() { string a = "test"; int i = a.TestMethod(); //Which one is chosen ? } } } I know that only one of the extension methods will be chosen. Which one will it be ? and why ? How can I choose a certain method from a certain namespace ? Edit: Usually I'd use Namespace.ClassNAME.Method() ... But that just beats the whole idea of extension methods. And I don't think you can use Variable.Namespace.Method()

    Read the article

  • How can I use a class with the same name from another namespace in my class?

    - by Beau Simensen
    I have two classes with the same name in different namespaces. I want one of these classes to reference the other class. The reason is that I am migrating to some newer code and I want to update the old code to simply pass through to the newer code. Here is a super basic example: namespace project { namespace legacy { class Content { public: Content(const string& url) : url_(url) { } string url() { return url_; } private: string url_; }; }} // namespace project::legacy; namespace project { namespace current { class Content { public: Content(const string& url) : url_(url) {} string url() { return url_; } private: string url_; }} // namespace project::current; I expected to be able to do the following to project::legacy::Content, but I am having trouble with some linker issues. Is this an issue with how I'm trying to do this, or do I need to look more closely at my project files to see if I have some sort of weird dependency issues? #include "project/current/Content.h" namespace project { namespace legacy { class Content { public: Content(const string& url) : actualContent_(url) { } string url() { return actualContent_.url(); } private: project::current::Content actualContent_; }; }} // namespace project::legacy; The test application compiles fine if I try to reference an instance of project::current::Content but if I try to reference project::current::Content from project::legacy::Content I get an: undefined reference to `project::current::Content::Content(...)` UPDATE As it turns out, this was a GNU Autotoolset issue and was unrelated to the actual topic. Thanks to everyone for their help and suggestions!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >