attributes

XPath ordered priority attribute search

I want to write an XPath that can return some link elements on an HTML DOM. The syntax is wrong, but here is the gist of what I want: //web:link[@text='Login' THEN_TRY @href='login.php' THEN_TRY @index=0] THEN_TRY is a made-up operator, because I can't find what operator(s) to use. If many links exist on the page for the given set of...

C# Attribute Limit

Is it possible to limit the number of properties that an attribute is applied to in a particular class? ...

VB.NET getting the attributes of a .wav file

How do I get the attributes of a .wav file using VB.NET. In particular, I am looking for a property which has the Duration of the .wav. Cheers ...

Having some trouble getting my classes to work together.

I am working on a simple ruby assignment and I am getting and internal server error. I am assuming it is in how I am tying my classes together. EDIT: I updated it and now I am just not inserting to the database. The point of issue is where I call "result = @dbh.query(query)" This is my first page: #!/usr/local/bin/ruby require 'cgi...

Getting NHibernate.Mappings.Attributes to work Options

I'm using v2.1 of NHibernate.dll and NHibernate.Mappings.Attributes v2.1 in a project. When I run the code further below, I get the following exception, and will be grateful for any pointers. On the same project, if I remove the attributes and use xml mapping files, it works fine. NHibernate.MappingException was unhandled Message="C...

ASP.NET How to remove 'style' attribute from input type='image' control ?

i am using an asp:ImageButton server control; i set the CssClass attribute to my CSS style, in which i defined border:solid 1px red; .NET automatically renders an inline 'style' attribute as follows: style="border-width:0px;" Q1. Can i remove the automatic inline 'style' ? e.g. on the PreRender perhaps inspect the HTML and edit it? ...

C#: How to Implement and use a NotNull and CanBeNull attribute

I want to let programmers and myself know that a method does not want null and if you do send null to it anyways, the result will not be pretty. There is a NotNullAttribute and a CanBeNullAttribute in Lokad Shared Libraries, in the Lokad.Quality namespace. But how does that work? I looked at the source-code of those two attributes, an...

C# Reflection : Finding Attributes on a Member Field

I may be asking this incorrectly, but can/how can you find fields on a class within itself... for example... public class HtmlPart { public void Render() { //this.GetType().GetCustomAttributes(typeof(OptionalAttribute), false); } } public class HtmlForm { private HtmlPart _FirstPart = new HtmlPart(); [Optional] //<-- ...

Change HREF attribute for right click save as?

So I have this... $(this).attr("href", "http://site.com/images/downloads/wp-" + $(this).parent().parent().attr("id") + "-1024x768.jpg"); The problem is that when I Right Click > Save Link As... it doesn't link to the proper image. I'm not sure if its possible to do this or not, but I would really appreciate it if someone could help me...

ORM framework/architecture which supports converting class definitions to dataset definitions in .NET

As part of a system which I am developing I need a method of taking a set of class definitions which define an object model and constructing a dataset from them which can then be populated by instantiating instances of the classes (either singletons or through collections for multiple table rows). The kind of approach I had in mind woul...

Why is SelectSingleNode returning null?

I'm working with an XML document that contains a structure that looks similar to this: <MT> <Events> <event id="1"> <field name="blah" value="a_value" type="atype" /> . . . </event> </Events> </MT> I'm currently loading this from a file into an XML document in this fashion: XmlDocument xdoc = ne...

In ASP.NET MVC, how to define in which sequence my custom attributes are checked/applied?

I'm currently investigating the possibility to use custom attributes derived from ActionFilterAttribute. I want to accomplish a couple of things with a couple of attributes. The thing is I want to make sure one of the attributes comes into play first, and not in any random sequence. Example: public class Feature1Attrubute : ActionFilte...

AS3: all key + values from XML attributes

<top> <item link="http://www.google.be"&gt;&lt;![CDATA[test]]&gt;&lt;/item&gt; <item link="http://www.google.be"&gt;&lt;![CDATA[test]]&gt;&lt;/item&gt; <item bold="true" link="http://www.google.be"&gt;&lt;![CDATA[test]]&gt;&lt;/item&gt; </top> I need to get all the attributes (both key and value) for each ( var item : XML in data.i...

Why is the html attribute returned as 'htmldecoded' even if encoded in html source?

I use html attribute title to set some hints like this: <a href... title="Go to next chapter">Go</a> Then the jquery plugin goes through all the [title] attributes and makes pretty tooltips. Very simplified a new div is created for the link above <div style="position:absolute...">Go to next chapter</div> The problem is, that the ...

JavaScript: changing the value of onclick with or without jQuery

I'd like to change the value of the onclick attribute on an anchor. I want to set it to a new string that contains JavaScript. (That string is provided to the client-side JavaScript code by the server, and it can contains whatever you can put in the onclick attribute in HTML.) Here are a few things I tried: Using jQuery attr("onclick",...

(Simple) Are HTML attributes allowed to have spaces between assignments

I'm doing some attribute parsing as a string, so I need to know how spaces are used in HTML/XHTML element attributes: <div id='myid' width='150px' /> Is this also correct? <div id = 'myid' width = '150px' /> If anyone knows other ways of iterating through attributes and their values using JavaScript, I'd be interested to know. ...

How to iterate through all attributes in an HTML element?

I need the JavaScript code to iterate through the filled attributes in an HTML element. This Element.attributes ref says I can access it via index, but does not specify whether it is well supported and can be used (cross-browser). Or any other ways? (without using any frameworks, like jQuery / Prototype) ...

display none when no images in jquery

I'm using jquery get the src of images to display:none when src="". It looks like that, <div class="parent"> <img src="images_path/or nothing" class="Images"/> <div class="content"> </div> </div> class content float left to fit with images width in parent div. Now I want detect image source when it empty I changed class content....

xsd attribute and element validation

I am trying to create an XSD schema which will validate the following xml. <Item ItemGUID="3F2504E0-4F89-11D3-9A0C-0305E82C3301">The name of the item</Item> I want to validate the max length of the attribute "ItemGUID" to 36 characters and "The name of the item" to a max 25 characters. How can it be validated to satisfy the above con...

Simple JQuery question - how do you add value to the title attribute?

Stupid question time - how do you update the title attribute of a control? Obviously this does not work: $("#valPageIndex").attr('title') = pageIndex; TIA ...