Search Results

Search found 2725 results on 109 pages for 'nodes'.

Page 12/109 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Javascript: Can't control parent of descendant nodes.

    - by .phjasper
    I'm creating elements (level 1) dynamically which in turn create elements (level 2) themselves. However, the children of level 2 elements have "body" as their parent. In the HTML code below, the content if spotAd2 is created by my function createNode(). It's a Google Ad Sense tag. However, the Google Ad Sense tag create elements that went directly under "body". I need them to by under spotAd2. function createNode( t, // type. tn, // if type is element, tag name. a, // if type is element, attributes. v, // node value or text content p, // parent f ) // whether to make dist the first child or not. { n = null; switch( t ) { case "element": n = document.createElement( tn ); if( a ) { for( k in a ) { n.setAttribute( k, a[ k ] ); } } break; case "text": case "cdata_section": case "comment": n = document.createTextNode(v); break; } if ( p ) { if( f ) { p.insertBefore( n, p.firstChild ); } else { p.appendChild( n ); } } return n; } spotAd2 = document.getElementById("spotAd2"); n1 = createNode("element", "div", {"id":"tnDiv1"}, "\n" , null, true); n2 = createNode("element", "script", {"type":"text\/javascript"}, "\n" , n1, false); n3 = createNode("comment", "", null, "\n" + "google_ad_client = \"pub-0321943928525350\";\n" + "/* 728x90 (main top) */\n" + "google_ad_slot = \"2783893649\";\n" + "google_ad_width = 728;\n" + "google_ad_height = 90;\n" + "//\n" , n2, false); n4 = createNode("element", "script", {"type":"text\/javascript","src":"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js"}, "\n" , n1, false); --- Result: <body> <table cellspacing="2" cellpadding="2" border="1"> <tbody><tr> <td>Oel ngati kemeie</td> <td>Kamakto niwin</td> </tr> <tr> <td>The ad:</td> <td> <div id="spotAd2"> <!-- Created by createNode() --> <div id="tnDiv1"> <script type="text/javascript"> google_ad_client = "pub-0321943928525350"; /* 728x90 (main top) */ google_ad_slot = "2783893649"; google_ad_width = 728; google_ad_height = 90; </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </div> <!-- Created by createNode() --> </div> </td> </tr> <tr> <td>txopu ra'a tsi, tsamsiyu</td> <td>teyrakup skxawng</td> </tr> </tbody></table> <!-- Created by adsense tag, need these to be under tnDiv1 --> <script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"></script> <script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"></script> <script>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);</script> <ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 90px; position: relative; visibility: visible; width: 728px;"> <ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 90px; position: relative; visibility: visible; width: 728px;"> <iframe width="728" scrolling="no" height="90" frameborder="0" vspace="0" style="left: 0pt; position: absolute; top: 0pt;" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-0321943928525350&amp;output=html&amp;h=90&amp;slotname=2783893649&amp;w=728&amp;lmt=1273708979&amp;flash=10.0.45&amp;url=http%3A%2F%2Fkenshin.katanatechworks.com%2Ftest%2FadsBrowserSide.php&amp;dt=1273708980294&amp;shv=r20100422&amp;correlator=1273708980298&amp;frm=0&amp;ga_vid=695691836.1273708981&amp;ga_sid=1273708981&amp;ga_hid=1961182006&amp;ga_fc=0&amp;u_tz=480&amp;u_his=2&amp;u_java=1&amp;u_h=1080&amp;u_w=1920&amp;u_ah=1052&amp;u_aw=1920&amp;u_cd=24&amp;u_nplug=5&amp;u_nmime=38&amp;biw=1394&amp;bih=324&amp;fu=0&amp;ifi=1&amp;dtd=955&amp;xpc=Jl67G4xiq6&amp;p=http%3A//kenshin.katanatechworks.com" name="google_ads_frame" marginwidth="0" marginheight="0" id="google_ads_frame1" hspace="0" allowtransparency="true"> </iframe> </ins> </ins> <!-- Created by adsense tag, need these to be under tnDiv1 --> </body>

    Read the article

  • Naming selenium grid nodes. Spawning a specific node

    - by ???? ????
    I'm trying to implement a kind of default queues in selenium hub. There is a possibility to specify node's name (actually its environment, smth like "firefox on ubuntu" or "chrome on windows"). Selenium grid itself has a default queue, it works according to 'First In, First Out' principle. But I want to prioritize some of my tasks given to selenium server. I have no possibility to introduce custom queue (seems like there is no API for that), that's why I decided to separate queue's logic from selenium server. I'll only call a specific node with specific name (environment) for example "firefox important node" or smth like that. So, I want to know how to directly tell selenium which node to use for my task? And generally, am I thinking in a right way? Here are my configs: hubConfig.json.erb { "host": null, "port": <%= node[:selenium][:server][:port] %>, "newSessionWaitTimeout": -1, "servlets" : [], "prioritizer": null, "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", "throwOnCapabilityNotPresent": true, "nodePolling": <%= node[:selenium][:server][:node_polling] %>, "cleanUpCycle": <%= node[:selenium][:server][:cleanup_cycle] %>, "timeout": <%= node[:selenium][:server][:timeout] %>, "browserTimeout": 0, "maxSession": <%= node[:selenium][:server][:max_session] %> } nodeConfig.json.erb { "capabilities": [ { "browserName": "firefox", "maxInstances": 5, "seleniumProtocol": "WebDriver" }, { "browserName": "chrome", "maxInstances": 5, "seleniumProtocol": "WebDriver" }, { "browserName": "phantomjs", "maxInstances": 5, "seleniumProtocol": "WebDriver" } ], "configuration": { "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", "maxSession": <%= node[:selenium][:node][:max_session] %>, "port": <%= node[:selenium][:node][:port] %>, "host": "<%= node[:fqdn] %>", "register": true, "registerCycle": <%= node[:selenium][:node][:register_cycle] %>, "hubPort": <%= node[:selenium][:server][:port] %> } } And my Driver class: ... def remote_driver @browser = Watir::Browser.new(:remote, :url => "http://myhub.com:4444/wd/hub", :http_client => client, :desired_capabilities => capabilities ) end def capabilities Selenium::WebDriver::Remote::Capabilities.send( "firefox", :javascript_enabled => true, :css_selectors_enabled => true, :takes_screenshot => true ) end def client client = Selenium::WebDriver::Remote::Http::Default.new client.timeout = 360 client end ... I still don't know how to use specified node for my task. If I try to start a driver adding :name => "firefox important node" and extend nodeConfig.json.erb's configuration with environments: - name: "firefox important node" browser: "*firefox" - name: "Firefox36 on Linux" browser: "*firefox" selenium just starts random firefox browser on a random node. How can I control it?

    Read the article

  • Using XSLT to Find Nodes Given a Set of Parameters

    - by davecardwell
    Sorry about the title—wasn’t sure how to word it. Basically I have some XML like this: <countries> <country handle="bangladesh"/> <country handle="india"/> <country handle="pakistan"/> </countries> And some XSLT like this (which doesn’t work): <xsl:template match="/countries"> <xsl:param name="popular"/> <xsl:apply-templates select="country[count($popular/country[@handle = current()/@handle]) &gt; 0]" /> </xsl:template> <xsl:template match="/countries/country"> … </xsl:template> I want to pass in a list of popular destinations like this: <popular> <country handle="india"/> <country handle="pakistan"/> </popular> …to the /countries template and have it only operate on the ones in the $popular param. At the moment this simply does nothing. Changing the selector to country[true()] operates on them all, so at least I know the basic structure is right. Any ideas? I think I may be getting confused by what is currently “current()”.

    Read the article

  • Schema for element with Attributes and Child nodes

    - by Matthew
    I am trying to write xsd type schema for an element that has a custom type to include addition attributes to extend a base type. I am running into trouble getting the syntax right. <xs:element name="graphs"> <xs:complexType> <xs:sequence> <xs:element name="graph" minOccurs="1" maxOccurs="unbounded" type="graphType"> <!-- child elements --> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="graphType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="title" type="xs:string"/> <xs:attribute name="type" type="xs:string"/> </xs:extension> </xs:simpleContent> </xs:complexType> I thought this would be something very common, but having read many tuts and forums, I cant seem to find an answer that works for me.

    Read the article

  • MSSQL "for xml", multiple tables, multiple nodes

    - by Nelson
    Is it possible to select multiple tables at once? For example, I can do: SELECT ( SELECT * FROM Articles FOR XML PATH('article'), TYPE ) FOR XML PATH('articles'), ROOT('data') and SELECT ( SELECT * FROM ArticleTypes FOR XML PATH('articleType'), TYPE ) FOR XML PATH('articleTypes'), ROOT('data') Can I join both so that I get the following output? I can't use UNION because the table structures don't match. <data> <articles> <article>...</article> ... </articles> <articleTypes> <articleType>...</articleType> ... </articleTypes> </data>

    Read the article

  • Grouping XSLT nodes via transformation

    - by scott
    I'm trying to create a page like this via XSLT transformation. Pages page1 page2 Links link1 link2 Here is the xml <siteMenu> <Pages> <title>page1</title> </Pages> <Pages> <title>page2</title> </Pages> <Links> <title>link1</title> </Links> <Links> <title>link2</title> </Links> </siteMenu> I tried using <xsl:for-each select="*"> and <xsl:for-each-group select="*" group-by="@v"> but that gives me every element, but how can i separate them out based on the parent node?

    Read the article

  • updating multiple nodes in xml with xquery and xdmp:node-replace

    - by morja
    Hi all, I wnat to update an XML document in my xml database (Marklogic). I have xml as input and want to replace each node that exists in the target xml. If a node does not exist it would be great if it gets added, but thats maybe another task. My XML in the database: <user> <username>username</username> <firstname>firstname</firstname> <lastname>lastname</lastname> <email>[email protected]</email> <comment>comment</comment> </user> The value of $user_xml: <user> <firstname>new firstname</firstname> <lastname>new lastname</lastname> </user> My function so far: declare function update-user ( $username as xs:string, $user_xml as node()) as empty-sequence() { let $uri := user-uri($username) return for $node in $user_xml/user return xdmp:node-replace(fn:doc($uri)/user/fn:node-name($node), $node) }; First of all I cannot iterate over $user_xml/user. If I try to iterate over $user_xml I get "arg1 is not of type node()" exception. But maybe its the wrong approach anyway? Does anybody maybe have sample code how to do this?

    Read the article

  • Find Adjacent Nodes A Star Path-Finding C++

    - by Infinity James
    Is there a better way to handle my FindAdjacent() function for my A Star algorithm? It's awfully messy, and it doesn't set the parent node correctly. When it tries to find the path, it loops infinitely because the parent of the node has a pent of the node and the parents are always each other. Any help would be amazing. This is my function: void AStarImpl::FindAdjacent(Node* pNode) { for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { if (pNode->mX != Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j].mX || pNode->mY != Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j].mY) { if (pNode->mX + i <= 14 && pNode->mY + j <= 14) { if (pNode->mX + i >= 0 && pNode->mY + j >= 0) { if (Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j].mTypeID != NODE_TYPE_SOLID) { if (find(mOpenList.begin(), mOpenList.end(), &Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j]) == mOpenList.end()) { Map::GetInstance()->mMap[pNode->mX+i][pNode->mY+j].mParent = &Map::GetInstance()->mMap[pNode->mX][pNode->mY]; mOpenList.push_back(&Map::GetInstance()->mMap[pNode->mX+i][pNode->mY+j]); } } } } } } } mClosedList.push_back(&Map::GetInstance()->mMap[pNode->mX][pNode->mY]); } If you'd like any more code, just ask and I can post it.

    Read the article

  • Edit and create nodes in a view?

    - by tputkonen
    We are storing people's class attendance information to Drupal. We would like to show this in a grid/chart, where the first column of each row shows person's name, and rest of the columns (ca. 20) either a checkbox or "X" if the user attended a class, or otherwise an non-checked box or empty column: (dates here) Jack X XXX X X Jill XX XXX XX It should also be possible to edit the attendance information on the grid. Each attendance information is a node of its own. This functionality can probably mostly be achieved using views and editablefields, but there is one problem: if a person has not attended a specific class he/she will not have at all an attendace node for that day. What would be the easiest way to create an attendace node in those cases, so that it would be possible for the end user to edit the grid by just clicking on the checkbox or typing an 'X'?

    Read the article

  • How to get child nodes after store load

    - by Azincourt
    Version: ExtJs 4.1 To change the child items I use this function: TreeStore (Ext.data.TreeStore) storeId : 'treeStore', ... constructor: function( oConfig ) { ... this.on( 'expand', function( oObj ) { oObj.eachChild(function(oNode) { switch(oNode.data.type) { case "report": oNode.set('icon', strIconReport); break; case "view": oNode.set('icon', strIconView); break; } }); }); Reload After removing or adding items in the tree, I reload the tree somewhere else with: var oStore = Ext.getStore('treeStore'); oStore.load({ node : oNode, params : { newpath : oNode.data.path, overwrite : true } }); Although it is the same store treeStore, after loading and expanding to the correct path, the icons are not changed since the .on( 'expand') function is not called. Why? Question How can I change the icons of this newly loaded store before it expands to the node path? What I tried Before calling .load() I tried to edit the children with oNode.eachChild(function(oChild) {} but no success.

    Read the article

  • Adding nodes to the edge of a path

    - by user146780
    Right now i'm drawing Polygons like this: http://img810.imageshack.us/img810/8530/uhohz.png As you can see some of the edges on the outline are wrong. How could I fix these edge issues, I think I'd need to add more verticies near the edges. How could I? Thanks

    Read the article

  • How to Search and Navigate XML Nodes

    - by edison681
    I have the following XML : <LOCALCELL_V18 ID = "0x2d100000"> <MXPWR ID = "0x3d1003a0">100</MXPWR> </LOCALCELL_V18> <LOCALCELL_V18 ID = "0x2d140000"> <MXPWR ID = "0x3d1403a0">200</MXPWR> </LOCALCELL_V18> <LOCALCELL_V18 ID = "0x2d180000"> <MXPWR ID = "0x3d1803a0">300</MXPWR> </LOCALCELL_V18> I want to get the inner text of each <MXPWR>. however, it is not allowed to use ID# to locate the inner text since it is not always the same. here is my code: XmlNodeList LocalCell = xmlDocument.GetElementsByTagName("LOCALCELL_V18"); foreach (XmlNode LocalCell_Children in LocalCell) { XmlElement MXPWR = (XmlElement)LocalCell_Children; XmlNodeList MXPWR_List = MXPWR.GetElementsByTagName("MXPWR"); for (int i = 0; i < MXPWR_List.Count; i++) { MaxPwr_form_str = MXPWR_List[i].InnerText; } } Any opinion will be appreciated.

    Read the article

  • Treeview nodes won't highlight using PopulateOndemand

    - by DrybLrac
    Hi everyone, I have a treeview and I want to highlight (change the text color) of a node in the treeview once that node has been selected. This isnt working for me for some reason. when I select a node nothing happens, but when I click the plus on the same node I just selected...it highlights...and even then when I click any of the childnodes, nothing happens and the root node stays highlighted always. Can anyone point me in the right direction...I'm using c#.

    Read the article

  • Controling images of nodes in a TreeView (C#)

    - by ET
    Hi, I am pretty new with GUI, and I guess that is a silly question, but I am stuck... I am trying to make a folder explorer using TreeView control. now, I added an ImageList with two images - one for a folder and the other for selected folder. I used the 'BeforeExpand' event to change the icon of the current node (folder). The problem is that I dont know how to change it back when the user selects other folder... what event can I use? Maybe I dont use it right... ? Thanks guys :)

    Read the article

  • Search for nodes by name in XmlDocument

    - by RajenK
    I'm trying to find a node by name in an XmlDocument with the following code: private XmlNode FindNode(XmlNodeList list, string nodeName) { if (list.Count > 0) { foreach (XmlNode node in list) { if (node.Name.Equals(nodeName)) return node; if (node.HasChildNodes) FindNode(node.ChildNodes, nodeName); } } return null; } I call the function with: FindNode(xmlDocument.ChildNodes, "somestring"); For some reason it always returns null and I'm not really sure why. Can someone help me out with this?

    Read the article

  • Adding nodes to a global linked-list

    - by Zack
    I am attempting to construct my first linked list, and having read a basic introduction, have done the following. Firstly, declare a linked list node as: struct errorNode { uint8 error; struct errorNode* next; }; Secondly, define the first node globally as: struct errorNode errorList = {0, NULL}; This has been done to allow each of the libraries that make up my current project to insert errors into a common list. The function to do this is: void errorListWrite(uint8 error) { struct errorNode* newNode = malloc(sizeof(struct errorNode)); newNode->error = error; newNode->next = &errorList; errorList = *newNode; } Whilst this compiles without error, it does not function as expected. I thnk the problem is with the last two statements of the list write function, but I am unsure. A hint as to what I am doing wrong would be most appreciated.

    Read the article

  • Grouping XSLT nodes via transformation dynamically

    - by scott
    I'm trying to create a page like this via XSLT transformation. Pages page1 page2 Links link1 link2 Here is the xml <siteMenu> <Pages> <title>page1</title> </Pages> <Pages> <title>page2</title> </Pages> <Links> <title>link1</title> </Links> <Links> <title>link2</title> </Links> </siteMenu> I tried using <xsl:for-each select="*"> and <xsl:for-each-group select="*" group-by="@v"> but that gives me every element, but how can i separate them out based on the parent node? I also want to make it dynamic so that if I add another item in siteMenu, it would update the xslt appropriately.

    Read the article

  • Put an array of Objects in nodes of another array of Objects [JAVA]

    - by zengr
    public class hello { public static void main(String[] args) { Object[] newarray = new Object[1]; Object[] obj = new Object[2]; obj[0] = "Number1"; //string value obj[1] = "Number2"; //string value newarray[0] = obj; //this works Object[] tmp_obj = new Object[2]; tmp_obj = newarray[0]; //obviously does not work System.out.println(tmp_obj[0]); //nope System.out.println(tmp_obj[1]); //nope } } So, now if I want to access the values "Number1" and "Number2" which are stored in obj[0] and obj[1]; obj is in newarray[0]. what should I do? Is this a possible? Thanks

    Read the article

  • Only the last node moves when multiple nodes are called for action

    - by Kriem
    Of the three parts I want to move, only the last one actually moves. I can't seem to "recycle" the ease action I created. How is this done the correct way? - init { // initial setup [self moveParts]; } - (void)moveParts { id action = [CCMoveBy actionWithDuration:1 position:ccp(0,160)]; id ease = [CCEaseInOut actionWithAction:action]; [part1 runAction:ease]; [part2 runAction:ease]; [part3 runAction:ease]; }

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >