attributes

Mark class/method obselete or depracated in C++

Is there a way of marking methods/classes in C++ as obselete as I would to in c# as follows: [Obsolete("You shouldn't use this method anymore.")] void foo(){} I use the GNU toolchain/Eclipse CDT if that matters. ...

XSLT and Line Feeds

I am using XSLT to reformat some XML, to (a) turn elements into attributes and (b) sort everything alphabetically. It works EXCEPT the attributes are all on one line. I understand this is usually preferable but in this case I need each attribute to appear on a separate line when I open the file in Notepad++ (or whatever). I can add XML-...

Hiding Control Attributes in ASP.Net

Hello I am building a composite control that is composed of an Infragistics WebDataGrid, an add Button, and some ModalPopupExtenders. I want design-time usage of this composite control to be as simple as possible. Meaning, as soon as they type not want there to be any AccessKey, EnableTheming, and all of those completely irrelevant prop...

Overriding an attribute in Rails and getting at the underlying value.

For the life of me, I can't figure out how to do this. I have a model for which the stored value is a path to a resource on the file system. I'd like the model to write and fetch the resource from the file system, so I naturally want to override the getter and setters to do this. How do I then get at the underlying value that's in the db...

Custom JSF component attribute list

I'm writting a custom JSF component that will render image transitions for a set of specified images. The list of images to be used by the component will be specified by the users of the component. The main component will do the rendering and the resulting markup is not html. I'm just learning JSF and I was wondering if there is an est...

Replacing attribute value in XSLT

I am trying to perform an XSL Transformation. But an attribute replacement doesn't work. I have this XSL: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:output encoding="UTF-8" doctype-public="-//WAPFORUM//DTD WML 1.1//EN" doctype-system="http://www.wapforu...

How to call an attr_accessor attribtue inside the class (but outside any methods)?

I'm using HTTParty for my class, and I want to use the default_params method. However, I also want to be able to set attributes when instantiation my class with initialize. class MyClass include HTTParty attr_accessor :param1, :param2 # This or @param1 doesn't work. default_params :param1 => self.param1, :param2 => self.param2...

Server-side Javascript (aspx.cs) Attributes.Add Code to Change a Label's text

I am trying to change a label's text by using server-side javascript (onclick) and C# within the page_load event. For example, I would like to write something like the following: Label1.Attributes.Add("onclick", "Label2.text='new caption'") Does anyone know the correct code for this? Also, what is this type of code referred to; is it...

AllowMultiple does not work with Property Attributes?

I'm tying to collect all Custom Attributes placed over a Property. There are more than one Attributes of the same type assigned to the Property, but when collecting them , the resulting collection only contains the first Attribute of the specific type: The Attribute class [AttributeUsage(System.AttributeTargets.Property, ...

How can I set attributes for SOAP elements in Delphi?

In a SOAP client request, the header needs this line: <NS2:Header Name="Foo">Bar<NS2:Header> So I wrote a class which has two string properties: the Content property - for the value of the element ("Bar") the Name property - for the value of the attribute ("Foo") The AS_ATTRIBUTE flag of the Name property should indicate that it ...

Do you commonly use Link Relations ("rel" attributes)?

I'm eager to move towards a more standards-based, accessible and semanticly-correct web development approach. At the office, I don't expect there to be huge changes straight away, but I'm trying to start laying down some of the basic foundations for progress further down the track. Part of this process is the introduction of the rel at...

C# - Custom Attributes

Hi! I want to log all calls to all class methods with a specific attribute. How would i do this? This is what I have so far: class ExecutionLogAttribute : Attribute { } public class Human { private Int32 age; [ExecutionLog] public void HaveBirthday() { age++; } } What would now be the best way to log al...

Read attribute from xml

Hi, Can someone help me read attribute ows_AZPersonnummer with asp.net using c# from this xml structure <listitems 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" xmlns="http://schemas.microsoft.com/s...

ASP.NET Can an object gets its attributes

Consider the following custom attribute: [Abc.Text(MaxLength=33)] public Abc.Text heading = new Abc.Text(); MaxLength is defined in the class TextAtrribute: public class TextAttribute : Attribute { public int MaxLength {get; set;} } In other code I have, the Text class needs to know its MaxLength. Is there a way I could do some...

Regex match spaces in html attribute

I have a bunch of html with lines like this: <a href="#" rel="this is a test"> I need to replace the spaces in the rel-attribute with underscores, but I'm sort of a regex-noob! I'm using Textmate. Can anyone help me? /Jakob ...

Using NHibernate.Mapping.Attributes on assembly with dependancies

Within my Entity assembly I have a class: public class MyClass : IAuditObject { // Implementation here } However the interface IAuditObject is defined in a separate Audit assembly. How can I successfully generate mappings using: NHibernate.Mapping.Attributes.HbmSerializer.Default.Serialize(MappingFile,EntityAssembly); where Ent...

SQL 2005 XML Schemas - Defining a Unique Attribute

Here's a Sample xml document I'm trying to create a schema for: '<Fields> <Field ID="-1">somevalue</Field> <Field ID="-2" /> <Field ID="-3" /> <Field ID="-4">Some other value</Field> <Field ID="-5" /> </Fields>' I'm trying to create a SQL Server 2005 schema collection to: 1. prevent dupicate id's. 2. only allow negative ids....

HTML img tag: title attribute vs. alt attribute?

i was browsing Amazon.com and noticed that a search such as a "1TB" hard drive: http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&amp;field-keywords=1TB if we move the mouse over the rating "stars" image, we will only see the score of it if we are using IE. If we use other browser like Firefox, Chrome, Safari, Opera, then th...

How do you know when looking at the list of attributes and methods listed in a dir which are attributes and which are methods?

I am working through trying to learn to program in Python and am focused on getting a better handle on how to use Standard and other modules. The dir function seems really powerful in the interpreter but I wonder if I am missing something because of my lack of OOP background. Using S.Lotts book I decided to use his Die class to learn m...

xsl strange behaviour using variables

I've stored a file's tree into $onto <xsl:variable name="onto" select="document('file.xml')"/> In some places I can use this variable as espected: <xsl:copy-of select="$onto/rdf:RDF"/> But I'm having trouble in other places, strange chars are written on output: <xsl:element name="autor"> <xsl:attribute name="rdf:resource"> ...