attributes

PHP SimpleXML doesn't preserve line breaks in XML attributes

I have to parse externally provided XML that has attributes with line breaks in them. Using SimpleXML, the line breaks seem to be lost. According to another stackoverflow question, line breaks should be valid (even though far less than ideal!) for XML. Why are they lost? [edit] And how can I preserve them? [/edit] Here is a demo fil...

How do i show the value of order comments in the order display grid?

I need to make use of the order comment history in sales order view page,and display the entered value in the order list.Though the textarea is for entering comment about order,I am using it to enter an id type value and would be inserted just once and that value should be displayed in the order grid under the header of the added custom ...

Ho to get custom attributes from an assembly that is not (really) loaded

We all know that the assembly can be queried for attributes using the GetCustomAttributes method. I want to use this to identify an extension module for my application. However, to avoid loading every assembly I prefer a defensive approach: using Assembly.ReflectionOnlyLoadFrom to get more details about an assembly (has it my ModuleAtt...

problem of entering text in combobox created by using <sx:autocompleter>

im trying to use autocompleter tag for displaying autosugget in my application,but with the following code i am not able to write in the combo box but has a populated list which is displayed when down arrow image(along with the combo box) is pressed. <sx:autocompleter list="state" name="StateName" list="{'CA','TR','GP','CL'}" searchT...

Problem with non-standard HTML attributes?

Possible Duplicates: Non-Standard Attributes on HTML Tags. Good Thing? Bad Thing? Your Thoughts? Is there a generic attribute for all HTML elements aside from ID and class? I have a series of divs that I would like to attatch extra info to. My idea was to use non-standard attributes to hold these values. Is this a bad idea, ...

How can I access the second element with the same attributes using Watir?

I have a page with HTML like this: <a href="1">reply</a> <a href="2">reply</a> I need to get value of href attribute for the second link. I can not use :text, because it will return href attribute for the first link. browser.link(:text, "reply").href => "{site}1" I can use :index, but if anything on that page changes, it could bre...

VB.NET XML Parser - Find elements with specific attribute & value

HI, I am using VB.NET to read an XHTML file. I need my program to find every element within the XML structure which has the "class" attribute set to a specific value. IE: I need an array (or similar list) of all elements from the document which contain class="mytag". There is a list of several values I need to detect, all of which sta...

Can you access a long description for a specific enum value.

I usually access enum description for a corresponding value like: Enum.GetName(typeof(MyEnum), myid); I need to have an enum that could use any chars like "hello world %^$£%&" I've seen people attaching an attribute and adding extensions like here: http://weblogs.asp.net/stefansedich/archive/2008/03/12/enum-with-string-values-in-c.as...

Attributes on Many-to-Many relationships (Hibernate)

Hi guys, I have entity classes A and C. They are mapping the tables tblA and tblC and have a many-to-many relationship between them, with tblB to map between them. tblB contains A_ID, C_ID and SetDate, the last one being the date it was set, thus an attribute to the relationship. My question is, how do I best map in this attribute? At t...

Find all nodes that have an attribute that matches a certain value with scala

Hi, I saw the following example on Nabble, where the goal was to return all nodes that contain an attribute with an id of X that contains a value Y: //find all nodes with an attribute "class" that contains the value "test" val xml = XML.loadString( """<div> <span class="test">hello</span> <div class="test"><p>hello</p></div> </div>""" )...

Using - in XML attribute name

Is it oke to use - in an xml element name? e.g. <rank-type>Rank</rank-type> ...

Is there any way to have a static regular expression class and use with attributes?

I would like to add a regular expression to a nattribute from a static class. [RegularExpression(MyRegex.DecimalRegEx)] from a class: public static class MyRegex { public static string Decimal_Between_1_And_100 { get { return (@"^\s*\d+(\.\d{1,2})?\s*$"); ...

how to get rel value of clicked element

hi im trying to get the rel value of a button that is click: function forwardStep() { $("#forwardStep").bind("click", function(){ var page = $(this).attr('rel'); thats pretty much the basis but is return "undifined". Do you know why? Regards Phil Jackson ...

Is there a way to allow 'this' attribute or 'this other' attribute, but not both?

I am trying to allow for two attribute values for one element. This is how I have it done now, but I only want to allow 1 of the 2, but not both. <contact phoneH="cell">8025550000</contact> <contact phoneW="work"> 8025550094</contact> I am looking to be able to do something like this: <xsd:attribute name="phoneH|phoneW" type="xsd:st...

Resources for Reflection and Attributes usage

Are there any good resources out there that explain attributes and reflection and their many uses in depth? I am especially interested in best practices, i.e. when it would be useful or appropriate to use attributes and reflection to solve specific computing problems. ...

Is it possible to modify the attribute of a property at runtime?

Is it possible to modify the attribute of a property at runtime? let's say I have some class: public class TheClass { [TheAttribute] public int TheProperty { get; set; } } Is there a way to do this? if (someCondition) { // disable attribute. Is this possible and how can this be done? } ...

Is there a limit to the length of HTML attributes?

How long is too long for an attribute value in HTML? I'm using HTML5 style data attributes (data-foo="bar") in a new application, and in one place it would be really handy to store a fair whack of data (upwards of 100 characters). While I suspect that this amount is fine, it raises the question of how much is too much? ...

Reusing xml for-each blocks in XSLT?

Hello, I have an attribute whose value is the XPath to the current node, like so: <xsl:attribute name="path"> <xsl:for-each select="ancestor-or-self::*"> <xsl:if test="name() != 'root'"> <xsl:value-of select="name()"> <xsl:if test="not(position()=last())"> <xsl:text>/</xsl:text> </xsl:if> ...

jquery accessing/changing value attribute of an element

hi, how to deal with value attribute of any element (hidden input in my case) i have tried with two styles alert($("#projectManager").attr("value")); and alert($("#projectManager").val()); but it returns 'undefined'. any help? ...

MVC Style Filters on ASMX Web Services, is it possible?

Hi, Is it possible to create MVC style filter attributes (like Authorize or HandleError) that work on ASMX Web Services? Specifically, I perform custom authentication on a number of my web methods and would like to wrap the code into an Attribute that throws an exception, if the authentication checks fail. Rich ...