element

XML element names

I need to redefine an XML document and schema for my company. The document in question is split into a number of sections that each contain information about a medication, for example; <dosage>overview of dose info <elderly>doses for elderly patients</elderly> <children>doses for children</children> </dosage> <administration>info...

How do I save xml exactly as is to a xml database field?

At the moment, if I save <element></element> to a SQL Server 2008 database in a field of type xml, it converts it to <element/>. How can I preserve the xml empty text as is when saving? In case this is a gotcha, I am utilising Linq to Sql as my ORM to communicate to the database in order to save it. ...

I need to have an HTML <select multiple> with a disabled element

I need a way to have a multi-select box that has a disabled element. I want the box to look like: All -----or----- option 1 option 2 with the "----or----" not being able to be selected. So far my code is pretty simple: <select multiple size="4" > <option value="0">All</option> <option value="1">----or----</option> <option ...

Prototype $$ returns array, should return one element like $

When using the dollar-dollar-function in prototype I alway get an array of elements back, instead of just one element with the dollar-function. How can I combine the power of CSS-selectors of $$ but still get only one element back? Changing the structure of the source is not possible, so I can't just select it with the id. It needs to g...

How to select unknown numbers in javascript?

So for example I have: array(2,1,3,4,5,6,7) and I already know (2,1,3) How should I get (4,5,6, 7) if I know that all numbers exists from 1 to 7 and the numbers what I already know So I want an array with the numbers what I don't know yet. Sorry if sounds stupid :| ...

C++ std::vector erasing element 0 throws exceptions

Sorry I can't provide code bc I don't have it. My coworker (who has been with the company for a long time but doesn't appear to know what he's doing) claims that he has to do some weird stuff to remove elements from a vector. He moves all the elements down a position (starting at the element that he wants to remove) then he'll remove t...

Enable/Disable HTML Element (IFrame) to Prevent or Allow Tabbing to it / Focusing it

Hi, Is there an easy way to enable or disable an IFrame to take it out of the Tab order? I’ve created a simple HTML page that has several links that when clicked show or hide an IFrame associated with the link and set the SRC property of the IFrame to one of my Wordpress blogs’ PressThis forms. This way I can easily add a post to any o...

General reasons not to deal with Document's and Element's prototype

Are there general reasons not to deal with Document's and Element's prototype? I like to create my own little framework, because my current project doesn't need the mass of features of the existing frameworks. I don't need to support browsers which don't support Element/Document-constructor and also will not execute scripts that are no...

How to get asp.net client id at external javascript file

Hello. when i use embedded javascript functions i can get client id of elements with this code for example : document.getElementById('<%=buttonXXX.ClientID%>' ) but now i am using external javascript file for caching and faster rendering but this code does not work any more for getting client id's of elements it gives error how can ...

Prolog type checking

Is there a way to determine the type of an element within a list in Prolog? I know that variables aren't explicitly typed in Prolog, but I need to check whether an element is a number, a specific character, etc. How can this be accomplished? ...

c++ multiply vector elements by a scalar value using STL

Hi I want to (multiply,add,etc) vector by scalar value for example myv1 * 3 , I know I can do a function with a forloop , but is there a way of doing this using STL function ? something like the {Algorithm.h :: transform function } ?? ...

Silverlight 4 custom control binding order is different when inside ContentControl.

I have a custom container control that has a number of dependency properties. One of which requires element binding. Most of the controls logic is within the OnApplyTemplate() method. When I test my control inside a normal panel or ItemsControl, everything works fine. However if the control is placed inside a ContentControl (which it...

HTML5 Validation Error

Basically I'm converting some template I made into html 5. Done a little research and tried to create a new element called 'wrapper'. All works fine cross browser etc, but when it came to validating i got this message: Line 16, Column 13: Element wrapper not allowed as child of element body in this context. (Suppressing further err...

javascript - remove element/node with no ID and specific content

I'm struggling to decipher a way to remove several specific href elements which contain no IDs and are children of individual parents with no IDs. The best I can manage is identifying the four offending, out of 8 or 9 href tags (and the number may vary), by a specific word within the URL itself. For this, I do the following: <script l...

How can I remove the text of a node without removing child nodes?

I'm working on creating XML docs from values in a database. Initially, the program exports this XML: <customDataElementlanguage>English</customDataElementlanguage> I've created this PHP to change the XML tree: if ($Element->nodeValue = "EN") { $Element->nodeValue = "English"; } $doc2 = $Element->ownerDocument; $titleElem...

width() and height() for modern browsers without jQuery

I am trying to implement a simple fold/unforld effect for elastic div's, i.e. when actual dimensions of an element are not set through CSS and thus are not trivially determinable. So I need equivalents of jQuery's width() and height() for arbitrary elements; the methods should return something that would be assignable to *.style.width/he...

JavaScript: Add elements in textNode

Hi, I want to add an element to a textNode. For example: I have a function that search for a string within element's textNode. When I find it, I want to replace with a HTML element. Is there some standard for that? Thank you. ...

How to get a XML element into an array in JSP

I have a simple XML file, such as: <shop> <row num="1"> <shelf1>Fruit</shelf1> <shelf2>Milk</shelf2> </row> <row num="2"> <shelf1>Pens</shelf1> <shelf2>Paper</shelf2> </row> </shop> And I'd like to put shelf1, shelf2, shelf3 and shelf4 into an array. Any ideas on where to start? I'm us...

How to i toggle a class on an Li element that is on a seperate page from my click function

Hello...I am attempting to create a dynamic favorites list in this application i'm working on. My problem at the moment is I cannot direct an event to toggle specific li class names. I have a large list of li's and seperate pages associated with them. Each page has a title bar with several image links, phone number, etc. the last image i...

the extjs effection(slidein slideout)

Hi: From the api I found extjs provide some basic animation,for exmaple the fadeIn fadeOut and etc. However when I use them, I meet some problems. I am confusing about the component of its show and hidden. The animation is called to the Element,for exapmle, form.getEl.fadeIn(...); But for a component,it has a attribute of hidden, ...