elements

xsd attribute and element validation

我怕爱的太早我们不能终老 提交于 2019-12-11 18:18:56
问题 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 condition using the xsd schema? 回答1: With XML Schema, you can do something like this: <xs:element name="Item"> <xs:complexType> <xs:simpleContent> <xs:extension base

can't find the element I need in Javascript with selenium to click on link

只谈情不闲聊 提交于 2019-12-11 15:16:01
问题 I can't find the element I need to tell selenium that I want it to click it, I believe it is because the page is generated by javascript can someone please help? maybe show me a way to do it and then explain how to find? the website I'm working on is www.howlongtobeat.com I want selenium to do the following: go to http://www.howlongtobeat.com => click on the search tab => enter "God of War (2018)" => click the link that pops up this is the code I have so far: from selenium import webdriver

jQuery binding live events

被刻印的时光 ゝ 提交于 2019-12-11 14:47:26
问题 I am having troubles binding live events to dynamically created content. I have a page which loads a html page through an ajax call. The loaded html page contains some javascript which is then executed. The executed javascript creates some elements. I want to bind a click event handler to those elements, however after binding them (using .live, .delegate and plain old .click) nothing happens after clicking on them. I am able to retrieve the contents of the elements (by calling .html) but I

xslt merge multiple nodes with same name

老子叫甜甜 提交于 2019-12-11 10:47:32
问题 I can see many answers to similar questions, but I can't seem to get them work for me. I have some xml files with some sibling element nodes having same tag name. I want to merge these nodes using XSLT. Any help would be deeply appreciated. Input: <?xml version="1.0"?> <Screen> <Shapes> <Triangle id="tri1"> <color>red</color> <size>large</size> </Triangle> </Shapes> <Shapes> <Rectangle id="rec1"> <color>blue</color> <size>medium</size> </Rectangle> </Shapes> <Shapes> <Circle id="cir1"> <color

Javascript/jQuery Click Element within Element

我的梦境 提交于 2019-12-11 09:13:29
问题 This is probably something quite easy to resolve, but for some reason, I can't figure it out. I have the following HTML: <li onclick="function_1();"> <input type="checkbox" onclick="function_2();"> <div onclick="function_3();"> </li> My issue is: Whenever I click one of the child elements (either the checkbox or div), it also carries out the function from the <li> --> function_1() . How can I prevent the parent element function from being called when child element is being clicked? What is

How to save the elements of a list individually in R?

痴心易碎 提交于 2019-12-11 06:43:48
问题 So I've got a pretty long list of elements, and I want to save each of these elements individually as a dataframe. Right, now I'm trying to do so by: for (i in 1:length(mylist)) { save.dta13(mylist[i], file=paste0(names(mylist)[i], ".dta")) } But that doesn't seem to be working, any ideas? 回答1: We can use lapply to loop over the names of the list lapply(names(mylist), function(nm) save.dta13(mylist[[nm]], paste0(nm, ".dta"))) 回答2: Here is another solution (slightly different from what akrun

Multiple image elements all fading when hovered in Jquery.

心已入冬 提交于 2019-12-11 06:25:07
问题 I'm having an issue with applying a fade to just one element on the page with the same ID. Firstly I fade the image down to 60% and then on hover I would like it to just 100% the image. This part works but it applies the effect to every element on the page. // Fading images $(document).ready(function(){ $('.mainArticle img').fadeTo('slow', 0.6); $('.mainArticle img, .articleContainer').hover(function(){ $(this).find('.mainArticle img, .articleContainer').stop(true,true).fadeTo("slow", 1.0); }

How to assign number of repeats to dataframe based on elements of an identifying vector in R?

…衆ロ難τιáo~ 提交于 2019-12-11 06:24:59
问题 I have a dataframe with individuals assigned a text id that concatenates a place-name with a personal id (see data, below). Ultimately, I need to do a transformation of the data set from "long" to "wide" (e.g., using "reshape") so that each individual comprises one row, only. In order to do that, I need to assign a "time" variable that reshape can use to identify time-varying covariates, etc. I have (probably bad) code to do this for individuals that repeat up to two times, but need to be

generate combinations of elements

喜欢而已 提交于 2019-12-11 04:59:47
问题 I have a vector of elements of 1:3 I want to generate the possible combinations of these elements so that I only have 1-2 , 1-3 and 2-3 . I've tried with expand.grid but get ALL possible ones when this is not what I want. How do I get the main three easily? expand.grid(1:3,1:3) Var1 Var2 1 1 1 2 2 1 3 3 1 4 1 2 5 2 2 6 3 2 7 1 3 8 2 3 9 3 3 回答1: combn(x = 1:3, m = 2, FUN = paste, collapse = "-") #[1] "1-2" "1-3" "2-3" #OR apply(X = combn(1:3,2), MARGIN = 2, FUN = paste, collapse = "-") #[1]

Change property of all instances of element on hover (CSS)

我的未来我决定 提交于 2019-12-11 04:19:35
问题 I have a group of article elements, using nth-child the odd ones have their background-colors set to blue and the rest red. See Here: http://jsfiddle.net/8KFwh/4/ I'm looking to be able to change the background color of all the article elements to white when you hover over just one of them. Furthermore the one that you hover over will change it's background-color to green, leaving all article elements white except for one. I know it would be easy to do in JS but I'm interested to know if it's