Search Results

Search found 803 results on 33 pages for 'xpath'.

Page 14/33 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Subreport within Subreport

    - by ysa
    Hi, I need to create a sub-report within a subreport, I'm using xpath as my query language. Any suggestion on how I can create it. To Illustrate it: Line Details - 1st sub-report Line Detail Info - 2nd sub-report Each Line Details can have 1 Line Detail Info. Thanks

    Read the article

  • How to scrap the first paragraphe from a wikipedia page?

    - by David
    Hi, Let's say i want to grab the first paragraphe in This wikipedia Page How to get the principal text between the title and CONTENTS box using XPath or DOM & PHP or something similar? Is there any php library for that? i don't want to use the api because it's a bit complex. Note: i just need that to add a widget under my pages that displays related infos from wikipedia. Thanks

    Read the article

  • How to scrape the first paragraph from a wikipedia page?

    - by David
    Let's say I want to grab the first paragraph in this wikipedia page. How do I get the principal text between the title and contents box using XPath or DOM & PHP or something similar? Is there any php library for that? I don't want to use the api because it's a bit complex. Note: i just need that to add a widget under my pages that displays related info from Wikipedia.

    Read the article

  • vb.net and html parsing

    - by tridat
    Currently I'm using the IHTMLDocument2 and IHTMLElementCollection to parse HTML, is there some way to parse it using some sort of xpath/selectors, something like elements = find_html_elements("a .link[rel=100]") ?

    Read the article

  • Navigation and WebBrowser control

    - by Neir0
    Hi, Can i use XPAth expressions to navigate through DOM elements in WebBrowser control? May be attaching javascript code and use document.evaluate function is right way? Can another activeX browser component(firefox,webkit.net) help me to solve my task?

    Read the article

  • Need help accessing PHP DOM elements

    - by Michael Pasqualone
    Hey guys, I have the following HTML structure that I am trying to pull information from: // Product 1 <div class="productName"> <span id="product-name-1">Product Name 1</span> </div> <div class="productDetail"> <span class="warehouse">Warehouse 1, ACT</span> <span class="quantityInStock">25</span> </div> // Product 2 <div class="productName"> <span id="product-name-2">Product Name 2</span> </div> <div class="productDetail"> <span class="warehouse">Warehouse 2, ACT</span> <span class="quantityInStock">25</span> </div> … // Product X <div class="productName"> <span id="product-name-X">Product Name X</span> </div> <div class="productDetail"> <span class="warehouse">Warehouse X, ACT</span> <span class="quantityInStock">25</span> </div> I don't have control of the source html and as you'll see productName and it's accompanying productDetail are not contained within a common element. Now, I am using the following php code to try and parse the page. $html = new DOMDocument(); $html->loadHtmlFile('product_test.html'); $xPath = new DOMXPath($html); $domQuery = '//div[@class="productName"]|//div[@class="productDetail"]'; $entries = $xPath->query($domQuery); foreach ($entries as $entry) { echo "Detail: " . $entry->nodeValue) . "<br />\n"; } Which prints the following: Detail: Product Name 1 Detail: Warehouse 1, ACT Detail: 25 Detail: Product Name 2 Detail: Warehouse 2, ACT Detail: 25 Detail: Product Name X Detail: Warehouse X, ACT Detail: 25 Now, this is close to what I want. But I need to do some processing on each Product, Warehouse and Quantity stock and can't figure out how to parse it out into separate product groups. The final output I am after is something like: Product 1: Name: Product Name 1 Warehouse: Warehouse 1, ACT Stock: 25 Product 2: Name: Product Name 2 Warehouse: Warehouse 2, ACT Stock: 25 I can't just figure it out, and I can't wrap my head around this DOM stuff as the elements don't quite work the same as a standard array. If anyone can assist, or point me in the right direction I will be ever appreciative.

    Read the article

  • Need Help About Using XPathNavigator in C#?

    - by Nano HE
    Hello. My XML file as below. It mixed schema and normal elements. <?xml version="1.0" encoding="utf-8"?> <!-- R1 --> <ax:root xmlns:ax="http://amecn/software/realtime/ax"> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="EquipmentConstants"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" ref="EquipmentConstant" /> </xsd:sequence> </xsd:complexType> <xsd:unique name="id"> <xsd:selector xpath=".//EquipmentConstant" /> <xsd:field xpath="@id" /> </xsd:unique> </xsd:element> ...... ...... </xsd:schema> <EquipmentConstants xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <EquipmentConstant id="0"> <Name>SerialNumber</Name> <Group>SYSTEM</Group> <Data> <Value min="0" max="10000000" scale_factor="0" unit="U_NO_UNITS" permission="NolimitedAndNoChangeable" type="xsd_string" enum="" flag="0">0</Value> </Data> <Description>Serial Number</Description> </EquipmentConstant> ..... ..... </EquipmentConstants> </ax:root> My C# code as below. I want to loop the elements from <EquipmentConstants xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> XPathDocument doc = new XPathDocument("test.xml"); XPathNavigator navigator = doc.CreateNavigator(); navigator.MoveToRoot(); // <?xml version="1.0" encoding="utf-8"?> //navigator.MoveToFirstChild(); // <!-- R1 --> // 1st, I tried to use MoveToChield(), But I failed to move there. navigator.MoveToChild("EquipmentConstants"); // Then, I also tried to use SelectSingleNode(). But I failed too. navigator.SelectSingleNode("ax/EquipmentConstants"); while (navigator.MoveToNext()) { // do something. } Could you please give me some suggestion. Thank you.

    Read the article

  • Count Total Number of XmlNodes in C#

    - by mjmcloug
    Hey, I'm trying to find a way to get the total number of child nodes from an XmlNode recursively. That it is to say I want to count all the children, grand children etc. I think its something like node.SelectNodes(<fill in here>).Count but I don't know what the XPath is. Thanks

    Read the article

  • Format form fields for bootstrap using rails+nokogiri

    - by user1116573
    I have the following in an initializer in a rails app that uses Twitter bootstrap so that it removes the div.field_with_errors that rails applies when validation fails on a field but also the initializer adds the help/validation text after the erroneous input field: require 'nokogiri' ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe form_fields = [ 'textarea', 'input', 'select' ] elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css("label, " + form_fields.join(', ')) elements.each do |e| if e.node_name.eql? 'label' html = %(#{e}).html_safe elsif form_fields.include? e.node_name if instance.error_message.kind_of?(Array) html = %(#{e}<span class="help-inline">&nbsp;#{instance.error_message.join(',')}</span>).html_safe else html = %(#{e}<span class="help-inline">&nbsp;#{instance.error_message}</span>).html_safe end end end html end This works fine but I also need to apply the .error class to the surrounding div.control-group for each error. My initializer currently gives the following output: <div class="control-group"> <label class="control-label" for="post_message">Message</label> <div class="controls"> <input id="post_message" name="post[message]" required="required" size="30" type="text" value="" /><span class="help-inline">&nbsp;can't be blank</span> </div> </div> but I need something adding to my initializer so that it adds the .error class to the div.control-group like so: <div class="control-group error"> <label class="control-label" for="post_message">Message</label> <div class="controls"> <input id="post_message" name="post[message]" required="required" size="30" type="text" value="" /><span class="help-inline">&nbsp;can't be blank</span> </div> </div> The solution will probably need to allow for the fact that each validation error could have more than one label and input that are all within the same div.control-group (eg radio buttons / checkboxes / 2 text fields side by side). I assume it needs some sort of e.at_xpath() to find the div.control-group parent and add the .error class to it but I'm not sure how to do this. Can anyone help? PS This may all be possible using the formtastic or simple_form gems but I'd rather just use my own html if possible. EDIT If I put e['class'] = 'foo' in the if e.node_name.eql? 'label' section then it applies the class to the label so I think I just need to find the parent tag of e and then apply an .error class to it but I can't figure out what the xpath would be to get from label to its div.control-group parent; no combination of dots, slashes or whatever seems to work but xpath isn't my strong point.

    Read the article

  • test="" on a boolean always returns true

    - by user70448
    Why does <xsl:if test="<XPATH to boolean value here>"> ... </xsl:if> ALWAYS return true? Since boolean can be 0,1,"false" and "true" by definition, the ONLY way to test for a boolean value is to do string comparison against these. This can't be right.

    Read the article

  • driver.findElement() with iframe and elements without ID

    - by user1864657
    Java Code: driver.switchTo().frame(0); WebElement elemText = driver.findElement(By.xpath("/html/body[contains(@class='forum')]")); //WebElement elemText = driver.findElement(By.xpath("//td[@id='cke_contents_vB_Editor_001_editor']/textarea")); elemText.sendKeys(message); elemText.submit(); forumLink = driver.getCurrentUrl(); HTML Code: <td id="cke_contents_vB_Editor_001_editor" class="cke_contents" style="height:1726px" role="presentation"> <iframe style="width:100%;height:100%" frameborder="0" title="Rich text editor, vB_Editor_001_editor, press ALT 0 for help." src="" tabindex="-1" allowtransparency="true"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" lang="en" contenteditable="true"> <head> <title data-cke-title="Rich text editor, vB_Editor_001_editor, press ALT 0 for help.">Rich text editor, vB_Editor_001_editor, press ALT 0 for help.</title> <base href="http://fairplay.garena.com/" data-cke-temp="1"> <link type="text/css" rel="stylesheet" href="http://fairplay.garena.com/clientscript/vbulletin_css/style00008l/editor_contents.css"> <style type="text/css" data-cke-temp="1"> form{border: 1px dotted #FF0000;padding: 2px;} img.cke_hidden{background-image: url(http://fairplay.garena.com/clientscript/ckeditor/plugins/forms/images/hiddenfield.gif?t=B37D54V);background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;} img.cke_iframe{background-image: url(http://fairplay.garena.com/clientscript/ckeditor/plugins/iframe/images/placeholder.png?t=B37D54V);background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;} img.cke_anchor{background-image: url(http://fairplay.garena.com/clientscript/ckeplugins/vblink/images/anchor.gif?t=B37D54V);background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 18px !important;height: 18px !important;} a.cke_anchor{background-image: url(http://fairplay.garena.com/clientscript/ckeplugins/vblink/images/anchor.gif?t=B37D54V);background-position: left center;background-repeat: no-repeat;border: 1px solid #a9a9a9;padding-left: 18px;} </style> </head> <body class="forum" spellcheck="true"> </body> </html> </iframe> </td> Image: http://s9.postimage.org/nwyvq3san/Screen_Shot038.jpg I can't find a way to get elements inside a iframe and without id. Can you help me?

    Read the article

  • selenium, get text from id

    - by user3766148
    on the following url - http://www.filestube.to/26frq-Buffalo-Clover-Test-Your-Love-2014-9Jai9TJFukAS9fq9sWngAD.html I am trying to copy the; Direct links: turbobit.net/9mrb0eu9eksx/26frq.Buffalo.Clover..Test.Your.Love.2014.rar.html via css path or xpath and unable to retrieve the information and store it to a variable. firebug gives me html body div.cnt div.rH.no-js.fd div.rl div.fgBx pre span#copy_paste_links but when I apply css=html.body.div.cnt.div.rH.no-js.fd.div.rl.div.fgBx.pre.span#copy_paste_links/text() to the target, I get error not found http://i.imgur.com/KdBmDHE.png

    Read the article

  • What is the best way to modify a few fields in an XML using Java

    - by Kailas J C
    I have a big XML which contains around 300 elements. I need to modify 2 or 3 elements in this xml using Java. I don't want to go for conventional marshalling and unmarshalling as it involves the parsing of the whole XML. How is XPath/XSLT manipulation? I know that I can easily read the data but i need to modify the same and put in back in the same XML. The primary concern here is performance. Kindly advise

    Read the article

  • c# update xml file

    - by Pila
    I want to replace a xml node that is not a child of the root element. how can I do it - not in .Net 3.5? I don't know the exact path to the node I want to replace, I get the node by XPath query like : XmlElement root = doc.DocumentElement; oldItem = root.SelectSingleNode("//Node1[@name='aaa']//Node2[Item='bbb']/Value"); how can I replace this olditem?

    Read the article

  • BizTalk server problem

    - by WtFudgE
    Hi, we have a biztalk server (a virtual one (1!)...) at our company, and an sql server where the data is being kept. Now we have a lot of data traffic. I'm talking about hundred of thousands. So I'm actually not even sure if one server is pretty safe, but our company is not that easy to convince. Now recently we have a lot of problems. Allow me to situate in detail, so I'm not missing anything: Our server has 5 applications: One with 3 orchestrations, 12 send ports, 16 receive locations. One with 4 orchestrations, 32 send ports, 20 receive locations. One with 4 orchestrations, 24 send ports, 20 receive locations. One with 47 (yes 47) orchestrations, 37 send ports, 6 receive locations. One with common application with a couple of resources. Our problems have occured since we deployed the applications with the 47 orchestrations. A lot of these orchestrations use assign shapes which use c# code to do the mapping. This is because we use HL7 extensions and this is kind of special, so by using c# code & xpath it was a lot easier to do the mapping because a lot of these schema's look alike. The c# reads in XmlNodes received through xpath, and returns XmlNode which are then assigned again to biztalk messages. I'm not sure if this could be the cause, but I thought I'd mention it. The send and receive ports have a lot of different types: File, MQSeries, SQL, MLLP, FTP. Each of these types have a different host instances, to balance out the load. Our orchestrations use the BiztalkApplication host. On this server also a couple of scripts are running, mostly ftp upload scripts & also a zipper script, which zips files every half an hour in a daily zip and deletes the zip files after a month. We use this zipscript on our backup files (we backup a lot, backups are also on our server), we did this because the server had problems with sending files to a location where there were a lot (A LOT) of files, so after the files were reduced to zips it went better. Now the problems we are having recently are mainly two major problems: Our most important problem is the following. We kept a receive location with a lot of messages on a queue for testing. After we start this receive location which uses the 47 orchestrations, the running service instances start to sky rock. Ok, this is pretty normal. Let's say about 10000, and then we stop the receive location to see how biztalk handles these 10000 instances. Normally they would go down pretty fast, and it does sometimes, but after a while it starts to "throttle", meaning they just stop being processed and the service instances stay at the same number, for example in 30 seconds it goes down from 10000 to 4000 and then it stays at 4000 and it lowers very very very slowly, like 30 in 5minutes or something. So this means, that all the other service instances of the other applications are also stuck in here, and they are also not processed. We noticed that after restarting our host instances the instance number went down fast again. So we tried to selectively restart different host instances to locate the problem. We noticed that eventually restarting the file send/receive host instance would do the trick. So we thought file sends would be the problem. Concidering that we make a lot of backups. So we replaced the file type backups with mqseries backups. The same problem occured, and funny thing, restarting the file send/receive host still fixes the problem. No errors can be found in the event viewer either. A second problem we're having is. That sometimes at arround 6 am, all or a part of the host instances are being stopped. In the event viewer we noticed the following errors (these are more than one): The receive location "MdnBericht SQL" with URL "SQL://ZNACDBPEG/mdnd0001/" is shutting down. Details:"The error threshold has been exceeded. The receive location is shutting down.". The Messaging Engine failed to add a receive location "M2m Othello Export Start Bestand" with URL "\m2mservices\Othello_import$\DataFilter Start*.xml" to the adapter "FILE". Reason: "The FILE adapter cannot access the folder \m2mservices\Othello_import$\DataFilter Start. Verify this folder exists. Error: Logon failure: unknown user name or bad password. ". The FILE adapter cannot access the folder \m2mservices\Othello_import$\DataFilter Start. Verify this folder exists. Error: Logon failure: unknown user name or bad password. An attempt to connect to "BizTalkMsgBoxDb" SQL Server database on server "ZNACDBBTS" failed. Error: "Login failed for user ''. The user is not associated with a trusted SQL Server connection." It woould seem that there's a login failure at this time and that because of it other services are also experiencing problems, and eventually they are shut down. The thing is, our user is admin, and it's impossible that it's password is wrong "sometimes". We have concidering that the problem could be due to an infrastructure problem, but that's not really are department. I know it's a long post, but we're not sure anymore what to do. Would adding another server and balancing the load solve our problems? Is there a way to meassure our balance and know where to start splitting? What are normal numbers of load etc? I appreciate any answers because these issues are getting worse and we're also on a deadline. Thanks a lot for replies!

    Read the article

  • How can I handle an empty namespace with XDocument.XPathEvaluate?

    - by Kevin
    I'm trying to use XDocument and XPathEvaluate to get values from the woot.com feed. I'm handling other namespaces fine, but this example is giving me problems. <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0"> <channel> <category text="Comedy" xmlns="http://www.itunes.com/dtds/podcast-1.0.dtd"> </category> <!-- this is a problem node, notice 'xmlns=' --!> So I try this: XmlNamespaceManager man = new XmlNamespaceManager(nt); man.AddNamespace("ns", "http://www.w3.org/2000/xmlns/"); // i've also tried man.AddNamespace("ns", string.Empty); xDocument.Namespace = man; var val = xDocument.XPathEvaluate("/rss/channel/ns:category/@text", xdwn.Namespace); val is always null. I'm using ns: from the suggestion from VS 2010 XPath Navigator plugin. Any thoughts on how to handle this?

    Read the article

  • Updating onclick's string value with Greasemonkey

    - by Devin McCabe
    I'm trying to write a Greasemonkey script to update the onclick value of a bunch of links on a page. The HTML looks like this: <a onclick="OpenGenericPopup('url-99.asp','popup',500,500,false)" href="javascript:void(0)">text</a> I need to update the url-99.asp part of the Javascript into something like urlB-99.asp. In my script, I'm collecting all the links with an XPath expression and iterating through them: var allEl = document.evaluate( 'td[@class="my-class"]/a', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allEl.snapshotLength; i++) { var el = allEl.snapshotItem(i); //something here; } If I try to alert(el.onclick), I get an error in the console: Component is not available I've read up on unsafeWindow and other Greasemonkey features, and I understand how to set an event handler for that link with a new onClick event, but how do I read the current onclick value into a string so I can manipulate it and update the element?

    Read the article

  • T-SQL XML Query, how to seperate matching nodes into individual rows?

    - by FlySwat
    I have a table that has a column full of XML like: <parent> <child> <name>Sally</name> </child> <child> <name>Bobby</name> </child> </parent> I'm trying to extract all of the names of the children into seperate rows. My desired resultset would look like: Sally Bobby However, if I do something like: SELECT data.query('data(//parents/child/name)') FROM stuff I get back a single row that looks like Sally Bobby What am I doing wrong with the XPath?

    Read the article

  • XML Document Depth?

    - by CrazyNick
    How to find the depth of the xml file using powershell/xpath? consider the below xml: <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book> <title>Harry Potter</title> <price>25.99</price> </book> <book> <title>Learning XML</title> <price>49.95</price> </book> </bookstore> depth of the above xml document is 3 (bookstore - book - title/price).

    Read the article

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