attributes

XSLT parse escaped HTML stored in an attribute and convert that attribute's content into element's content

Hello Guys, I'm stuck on what I think should be simple thing to do. I've been looking around, but didn't find the solution. Hope you will help me. What I have is an XML element with an attribute that contains escaped HTML elements: <Booking> <BookingComments Type="RAM" comment="RAM name fred&lt;br/&gt;Tel 09876554&lt;br/&gt;Emai...

Is .Net attribute feature used at compile-time or run-time or both?

In .Net, is the attribute feature used at compile-time or run-time or both? Can you give me some examples? ...

How to setup a Zend_Form_Element_Select with multiple params at OPTION tags

Hi. I am creating a Zend Form to allow the user to change the current Locale from a list saved in my DB. I would like to know how to add more attribs to the option list. $obj_locales_select = new Zend_Form_Element_Select('sel_locale'); $obj_locales_select->setLabel('form-params-language-changelocale-sel_locale-label'); $obj_locales_sele...

Rails will return an object successfully, but complains that the object is NIL if I try to access an attribute of it

I am trying to populate a nested field, product_name, it an Item. In my Item model: class Item < ActiveRecord::Base attr_writer :product_name belongs_to :order belongs_to :product def product_name #Product.find_by_id(self.product_id) #=> returns the product object #self.product #=> returns the product object ...

Replace multiple times using jQuery.

I'm extremely new to jQuery and JS in general. I need the script to scan a page and replace any images classed 'rounded' with a wrapper div so I can apply rounded corners through css3. The code I've done works perfectly except if there's more than 1 image on the page, it just returns the first image 3 times instead of 3 separate images....

get attribute values from string key

Hi i need to obtain the value of attribute of a model by passing the name of attribute like string. ex model["ModelID"] is there any method for this? thanks ...

XPath Select node from current node value when the two attribute names are the same

Hi all, Can anyone help me with this little issue I am having. The XML <MPN> <MTR MSN="AB123456"/> <MTR MSN="AB654321"/> <MTR MSN="AB654322"/> <MTR MSN="AB654323”/> <MTR MSN="AB654324"/> <JOB JobId="136"> <JMR MSN="AB123456"> <JRA DateActionRequiredBy="20090701120012" /> </JMR> ...

How to get a custom attribute from object instance in C#

Let's say I have a class called Test with one property called Title with a custom attribute: public class Test { [DatabaseField("title")] public string Title { get; set; } } And an extension method called DbField. I am wondering if getting a custom attribute from an object instance is even possible in c#. Test t = new Test();...

.NET DefaultValue attribute

I've heard people say a few different things about the DefaultValue attribute including: "It sets the value of the property before anything else uses it." "It doesn't work for autoproperties." "It's only for decoration. You must manually set actual default values." Which (if any) is right? Does DefaultValue actually set default...

jQuery check if element have specific attribute

I am trying to see if an element have a specific CSS attribute. I am thinking at something like this: if ( !$(this).attr('font-style', 'italic')) { alert ("yop") } else { alert ("nope") } It does not work. Any tips on this? Thank you! ...

When we must use DebuggerDisplay Attributes? What is the advantage of using this?

When we must use DebuggerDisplay Attributes? What is the advantage of using this? ...

Covariance, Contravariance and Delegate Problem

Hi there, I again need help by you, this time I struggle with covariance, contravariance, delegates and an simple idea blowing up... I want to implement an attribute for our businessobject-properties that takes a delegate and the needed parameters for that one, so that I can work with reflection, read out the attribute and perform a va...

Jquery: Conditional reference to attribute?

Hi, Is it possible to refer to an attribute of an element conditionally with Jquery? What I'm after is something like: $(".mylink":rel["2"]).show(); ... which would "show the specific instance of .mylink element on the page that has rel="2" HTML attribute on it. There would be multiple instances of .mylink on the page, each with its...

How can I set the Name attribute of an input field using Jquery?

Hey guys, Quick question... I was wondering how I can get this to happen. Okay I have an input field like such: <input type="text" id="input1" size="10" name="" value="" class="checked other_amount" onfocus="Toggle('radio1', 'input1');" /> I would like to click on a div with an ID of #resetPrompt and fill the empty name attr from th...

Apply C# Attribute to Extension Method to Manage Extension Method Execution like an Action Filter

Hi All I have a HtmlHelper extension method that I would like to apply some logic to before execution. I suppose I'm looking for behaviour similar to Action Filters, abut I thought I could do this by applying an Attribute to a method without the need of a Filter Context. This is my extension method: [MyHelperAttribute] public static s...

Jquery get the title Attribute, problem

The title attribute didn't shows. If you have a tip using another attribute type, I just need to get this data to put in the div, let me know please. $(function() { var offsetY = 10; $('a').hover(function(e) { var title = $(this).attr('title'); $('<div id="PopRoll">'+title+'</div') .css('top', e.pageY ...

Attributes: Are the current REST-architecture tools limited to a tree-structure?

Historically operating system directory-structures have been trees: C: Windows System32 Program Files Common Files Internet Explorer And the REST architecture emulates the same thing: http://...//Thomas/ http://...//Thomas/Mexico/Year2003/Photos http://...//Thomas/Mexico/Year2007/Photos http://...//Thomas/Finland/Year2005/Pho...

How do I apply a "template" or "skeleton" of code in C# here?

In my business layer, I need many, many methods that follow the pattern: public BusinessClass PropertyName { get { if (this.m_LocallyCachedValue == null) { if (this.Record == null) { this.m_LocallyCachedValue = new BusinessClass( this.Database, this.Pro...

ASP.NET MVC2 - Resolve Parameter Attribute in Model Binder

Given an action like: public ActionResult DoStuff([CustomAttribute("foo")]string value) { // ... } Is there any way to resolve the instance of value's CustomAttribute within a ModelBinder? I was looking at the MVC sources and chances are I'm just doing it wrong, but when I tried to replicate their code which retrieves the BindAttrib...

Dictionary-like object in Python that allows setting arbitrary attributes

What I want to do in my code: myobj = <SomeBuiltinClass>() myobj.randomattr = 1 print myobj.randomattr ... I can implement a custom SomeClass that implements __setattr__ __getattr__. But I wonder if there is already a built-in Python class or simple way to do this? ...