attributes

How to add attributes to an element using LINQ, C#?

Hi, I have an XElement object which has a number of attributes and I simply want to add another attribute to the element. How do I do this? Thanks, Matt. ...

Can the rel= attribute contain any string characters and still validate?

I'm wondering because I want to store something other than pre-defined keywords that are typically assigned to rel... and I just wanted to know if this is valid XHTML Strict or not. ...

Xpath - How to get all the attribute names and values of an element

I am using xpath in java. I want to get all the attributes (name & Value) of an element. I found the query to get the attribute values of an element, now I want to get attribute names alone or names and values in single query. <Element1 ID="a123" attr1="value1" attr2="value2" attr3="value3" attr4="value4" attr5="value5" /> Here using ...

Accessing wrapped method attribute in C#

I have following code: public static void ProcessStep(Action action) { //do something here if (Attribute.IsDefined(action.Method, typeof(LogAttribute))) { //do something here [1] } action(); //do something here } For easy use I have some similar methods using method above. For example: public static vo...

Magento- custom attribute causes blank order number.

Hi- I created a simple custom attribute on the sales/order entity. Now, for new orders, order number is null. I looked at the sales_order table, and sure enough, increment_id is null... can anyone help me out, I am stumped? This is my setup.php: `public function getDefaultEntities() { return array( 'order' => arra...

Attribute class not calling constructor

I have created an Attribute, call MyAttribute, which is performing some security and for some reason the Constructor is not being fired, any reason why? public class Driver { // Entry point of the program public static void Main(string[] Args) { Console.WriteLine(SayHello1("Hello to Me 1")); Console.WriteLine...

Changing a php "echoed" div attribute with php

Hi everybody, I'm using PHP to echo a content stored on my database. The content is a DIV carrying any type of data. The problem is that I don't know the ID and I have some problems with these DIVs if I try to display them more that once. So, the idea is to modify the DIV id each time I'd like to display them. Something like this: <?...

The case of "id" attribute when signing an element in a XML file

Is the case of the "id" attribute important, when creating a reference to an element for digital signing following xml-dsig standard? I've seen attributes named "ID", "Id" and "id" and some software packages have trouble finding the correct element/node for different forms. Also following various specs and schemas, there are different ...

Adding a onclick event to a code generated html element via object initializer

I would like to be able to add a click event to a entity generated in the code behind. Currently I'm doing it like this: TableRow row = new TableRow(); row.Attributes.Add("onclick", "clickFunction(this)"); Is there a way to do this using the object initializer? I am doing a lot of control creation/initialization and if it matched ...

How may I use Firebug to view attributes of jQuery-retrieved objects at a breakpoint?

For instance, I've hit a break point on a line of code where I'm setting the height of one div equal to the height of another: $("#box_left").height = $("#box_right").height; How do I view the value of 'height'? All firebug ever shows me is 'function()'. :( ...

Problem parsing an atom feed using simplexml_load_file(), can't get an attribute.

Hi, I am trying to create a social timeline. I pull in feeds form certain places so I have a timeline of thing I have done. The problem I am having is with Google reader Shared Items. I want to get the time at which I shared the item which is contained in <entry gr:crawl-timestamp-msec="1269088723811"> Trying to get the element using $...

How do I prevent a C# method from executing using an attribute validator?

I'd like to create an attribute-based validator that goes a few steps beyond what I've seen in examples. It'll basically prevent methods or other functionality from executing. Please be aware that I'm having to use AzMan since I have no availability to Active Directory in this scenario. Here's some pseudo code of what what I'm looking ...

How do you Read the value of an attribute in a Method

I need to be able to read the value of my attribute from within my Method, how can I do it? [MyAttribute("Hello World")] public int MyMethod() { //Need to read the MyAttribute attribute and get its value } ...

switching from EnterpriseLibrary.Validation to Microsoft.Practices.EnterpriseLibrary.Validation.Validators to System.ComponentModel.DataAnnotations

I'm moving some code from Microsoft.Practices.EnterpriseLibrary.Validation.Validators to System.ComponentModel.DataAnnotations, and have come across a more complex validator that I am having trouble in changing it to DataAnnotations, anyone got any pointers on how I can convert this? [NotNullValidator] [DomainValidator("M", "F", "A", Me...

advanced xml? multi level .. php parsing

hi my knowledge of xml and php is somewhat basic but have been able to parse a simple xml document (one level) ~ <numbers> <number>1</number> <number>2</number> </numbers> i'm attempting to parse an xml document from a website providing the latest market prices for gold bullion. I think i'm going to need a paid professional but...

C# Attributes and Metadata implication

Hi, I read tutorials from the web about C# Attributes and Metadata. It's very cool but I'm wondering its implication. Are (custom) attributes loaded when the assembly is loaded? or is it only when you use reflection to retrieve the metadata? It seems the attributes add to the total of code size because it gets compiled in to the execut...

RegexValidator to validate emails, making standard attribute

I would like to validate an email using the RegexValidator, e.g. [RegexValidator(@"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$")] Which works fine, now I want to wrap the attribute so I can store this in one place: public class EmailAttribute : RegexValidator { public EmailAttribute(...

Customized design-time attribute for WPF

I've created a custom control, and would like to create an attribute (available in Blend's design-time) which would offer a dropdown or combobox. The designer would then select one of the available options. Very much like the "Cursor" combo in the "Common Properties" tab, except that I want full control over what items go in the combo....

Cannot embed interop types from assembly "...\Microsoft.Search.Interop.dll" because it is missing the GuidAttribute attribute

Hello all, I get this error when adding a reference to the Microsoft.Search.Interop.dll library in a new project that I created. Microsoft.Search.Interop.dll is a library that provides some useful API to communicate with Windows Search. I use it in order to add a folder to the system indexer. Did anybody else get this error, and if so...

Populate properties decorated with an attribute

Are there any frameworks that assist me with this: (thinking that perhaps StructureMap can help me) Whenever I create a new instance of "MyClass" or any other class that inherits from IMyInterface I want all properties decorated with [MyPropertyAttribute] to be populated with values from a database or some other data storage using the p...