Search Results

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

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

  • Can YQL parse web sites requiring cookie-based authentication?

    - by user249488
    First, my use case: I'm trying to use YQL's built in XPATH capabilities to scrape content from Yahoo! Fantasy Sports. It uses some sort of cookie-based authentication scheme. Basically, the sequence is: 1) Do an HTTP GET on the Yahoo! Login page 2) Parse the hidden inputs from the response and do an HTTP PUT with your Yahoo! Login on the form URL 3) Use the cookies returned from step 2 to GET any of the Fantasy Sports! websites that you have access to My question is, does YQL support doing this to scrape data? The only authentication based examples I've seen use OAuth, but I haven't seen any examples of using YQL to parse websites with cookie-based authentication schemes

    Read the article

  • Fast search in XMl files in .NET (or How to index XML files)

    - by codymanix
    I have to implement a search feature which is able to quickly perform arbitrary complex queries to XML-data. If the user makes a query, all XML files must be searched to find possible matches. The users will have lots of XML-Files (a few 10000 or more) which are typically a few kilobytes in size. All the XML-files have almost the same structure. I already benchmarked XPath, it is too slow for my needs. How can it be done most efficiently? Is is possible to create indexes for the contents of the XML files (preserving content semantics, not just plain fulltext search)? Will it be useful to put the XML data into an (embedded) SQL database and do the queries with SQL? What other possibilities do I have?

    Read the article

  • Object tree navigation language in Java

    - by lewap
    In the system which I'm currently developing I often have to navigate an object tree and based on its state and values take actions. In normal Java this results in tedious for loops, if statements etc... Are there alternative ways to achieve tree navigation, similar to XPath for XML? I know there is JXPath and OGNL, but do you know any other libraries for such purpose? Do you know any libraries which generate bytecodes for specific tree navigation expressions to make the processing as fast as Java native fors and ifs?

    Read the article

  • issue with a xmlns

    - by Josemalive
    Hello, I have an xml file and an xslt file. The xml file has a xmlns="exa:com.test" attribute. If i remove this attribute in the xml the xpath sentences in my xslt works. But if i leave it, doesnt work. Im using the following code to mix xml and xslt: XslCompiledTransform transformer = new XslCompiledTransform(); transformer.Load(HttpContext.Current.Server.MapPath("xslt\\searchresults.xslt")); transformer.Transform(xmlreader, null, utf8stringwriter); What im doing wrong? How could i mix xml and xslt if the xml has the xmlns attribute on top? Thanks in advance. Best Regards. Jose

    Read the article

  • Delete / Remove node from XPathNodeIterator, given an XPath

    - by RymdPung
    First of all, if someone has a different, perhaps shorter (or better), solution to the problem, it's welcome as well. I'm trying to "simply" remove (almost) duplicate elements in XSLT. There's some (metadata) nodes i don't want to include when comparing, and i couldn't figure out how do do that in XSLT so thought i'd extend it with a function removing these nodes. Like so: <xsl:for-each select="abx:removeNodes(d/df600|d/df610|d/df611|d/df630|d/df650|d/df651|d/df655, '*[@key=&quot;i1&quot; or @key=&quot;i2&quot; or key=&quot;db&quot;]')"> <xsl:if test="not(node()=preceding-sibling::*)"> blah </xsl:if> </xsl:for-each> And the extension, which doesn't work so well... (C#) public XPathNodeIterator removeNodes(XPathNodeIterator p_NodeIterator, String removeXPath) { Logger Logger = new Logger("xslt"); Logger.Log("removeNodes(removeXPath={0}):", removeXPath); foreach (XPathNavigator CurrentNode in p_NodeIterator) { Logger.Log("removeNodes(): CurrentNode.OuterXml={0}.", CurrentNode.OuterXml); foreach (XPathNavigator CurrentSubNode in CurrentNode.Select(removeXPath)) { Logger.Log("removeNodes(): CurrentSubNode.OuterXml={0}.", CurrentSubNode.OuterXml); // How do i delete this node!? //CurrentSubNode.DeleteSelf(); } } return p_NodeIterator; } My initial approach using 'CurrentSubNode.DeleteSelf();' doesn't work because it gets confused and loses its position in the XPathNavigator, causing it to only delete the first item it finds using "removeXPath". Something like a DeleteAndMoveNext() would be nice but there seems to be no such method... Example data: <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> <df650 key="db">someDB</df650> <df650 key="id">b2</df650> <df650 key="dsname">someDS</df650> </df650> ..and then another identical node (if you ignore the meta fields; db,id,dsname). <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> <df650 key="db">someOtherDB</df650> <df650 key="id">b2</df650> <df650 key="dsname">someOtherDS</df650> </df650> The result should be... <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> </df650>

    Read the article

  • SOAPUI Extract data from SOAP Response and use in REST request

    - by Adrian
    I have been looking at the answer to this question: Pulling details from response to new request SoapUI which is similar to what I am looking for but I can't get it to work. I have a small SOAPUI testsuite and I need to extract a value from the response of a SOAP request and then use this value in a subsequent REST request. The response to my SOAP request is: <ns0:session xmlns:ns0="http://www.someurl.com/la/la/v1_0"> <token>AQIC5wM2xAAIwMg==#</token> </ns0:session> so I need the token to use in my REST request. I know it involves using Property Transfer and some XPath / XQuery but I just can't get it right. At the moment my property transfer window points to Source: SOAP test Property: Response and has data(/session/token/text()) in the text box. In target it has Target: REST testcase Property: newProp and I have Use XQuery checked. Any help greatly appreciated. Thanks, Adrian

    Read the article

  • DotNetNuke + XPath = Custom navigation menu DNNMenu HTML render

    - by Rui Santos
    I'm developing a skin for DotNetNuke 5 using the Component DNN Done Right menu by Mark Alan which uses XSL-T to convert the XML sitemap into an HTML navigation. The XML sitemap outputs the following structure: <Root > <root > <node id="40" text="Home" url="http://localhost/dnn/Home.aspx" enabled="1" selected="0" breadcrumb="0" first="1" last="0" only="0" depth="0" > <node id="58" text="Child1" url="http://localhost/dnn/Home/Child1.aspx" enabled="1" selected="0" breadcrumb="0" first="1" last="0" only="0" depth="1" > <keywords >Child1</keywords> <description >Child1</description> <node id="59" text="Child1 SubItem1" url="http://localhost/dnn/Home/Child1/Child1SubItem1.aspx" enabled="1" selected="0" breadcrumb="0" first="1" last="0" only="0" depth="2" > <keywords >Child1 SubItem1</keywords> <description >Child1 SubItem1</description> </node> <node id="60" text="Child1 SubItem2" url="http://localhost/dnn/Home/Child1/Child1SubItem2.aspx" enabled="1" selected="0" breadcrumb="0" first="0" last="0" only="0" depth="2" > <keywords >Child1 SubItem2</keywords> <description >Child1 SubItem2</description> </node> <node id="61" text="Child1 SubItem3" url="http://localhost/dnn/Home/Child1/Child1SubItem3.aspx" enabled="1" selected="0" breadcrumb="0" first="0" last="1" only="0" depth="2" > <keywords >Child1 SubItem3</keywords> <description >Child1 SubItem3</description> </node> </node> <node id="65" text="Child2" url="http://localhost/dnn/Home/Child2.aspx" enabled="1" selected="0" breadcrumb="0" first="0" last="1" only="0" depth="1" > <keywords >Child2</keywords> <description >Child2</description> <node id="66" text="Child2 SubItem1" url="http://localhost/dnn/Home/Child2/Child2SubItem1.aspx" enabled="1" selected="0" breadcrumb="0" first="1" last="0" only="0" depth="2" > <keywords >Child2 SubItem1</keywords> <description >Child2 SubItem1</description> </node> <node id="67" text="Child2 SubItem2" url="http://localhost/dnn/Home/Child2/Child2SubItem2.aspx" enabled="1" selected="0" breadcrumb="0" first="0" last="1" only="0" depth="2" > <keywords >Child2 SubItem2</keywords> <description >Child2 SubItem2</description> </node> </node> </node> </root> </Root> My Goal is to render this XML block into this HTML Navigation structure only using UL's LI's, etc.. <ul id="topnav"> <li> <a href="#" class="home">Home</a> <!-- Parent Node - Depth0 --> <div class="sub"> <ul> <li><h2><a href="#">Child1</a></h2></li> <!-- Parent Node 1 - Depth1 --> <li><a href="#">Child1 SubItem1</a></li> <!-- ChildNode - Depth2 --> <li><a href="#">Child1 SubItem2</a></li> <!-- ChildNode - Depth2 --> <li><a href="#">Child1 SubItem3</a></li ><!-- ChildNode - Depth2 --> </ul> <ul> <li><h2><a href="#">Child2</a></h2></li> <!-- Parent Node 2 - Depth1 --> <li><a href="#">Child2 SubItem1</a></li> <!-- ChildNode - Depth2 --> <li><a href="#">Child2 SubItem2</a></li> <!-- ChildNode - Depth2 --> </ul> </div> </li> </ul> Can anyone help with the XSL coding? I'm just starting now with XSL..

    Read the article

  • Help finding table cell using locator after tableCellAddress finds the cell

    - by Greg Weinman
    Hi All, I have a JSP page populated by javascript resulting in a typical table element cascade . After population I see the text I want using getTable("tableLister.listTable.1.1") The table also has a class=clsDisplayTableBody. I want to click the check box in column 0 for the row of interest. However, all of these tests fail isElementPresent("//*[text()="+cellContents+"]/../td[0]")) isElementPresent("//table[@class='clsDisplayTableBody']//tr[1]/td[0]")) isElementPresent("css='clsDisplayTableBody' tr:nth-child(1) td:nth-child(0)")) isElementPresent("//xpath=id('tableLister.listTable')/descendant::tr[1]/descendant::td[0]")) isElementPresent("//table[@id='tableLister.listTable']//tbody/tr[1]/td[0]")) isElementPresent("//table[@id='tableLister.listTable']//tr[1]/td[0]")) Is there anything else I could try? Regards, Greg Weinman

    Read the article

  • Moving ordered elements and adding arbitrary text in Deliverance

    - by Jon Hadley
    Using the following XPath derived rule, I am able to select a list of events from a Plone site (similar to Plone Community events) and display them in my Deliverance themed site: <replace content="//*[@id='parent-fieldname-title' or @class='explain' or @id='parent-fieldname-location' or @id='parent-fieldname-text']" theme="#center-content-to-replace-one" /> However, two separate, but related, problems now rear their heads. I can't work out how to: Re-order elements within the replaced theme, such as moving images originally held within #parent-fieldname-text to before #parent-fieldname-title Put arbitrary text before elements. Such as 'Page Title:' before #parent-fieldname-title I could do both if I was just dealing with one record, as place holders(1) or text before place holders(2) could be specified in the template - but I can't see a away for that template behaviour to repeat across multiple items in one page. (if that is indeed the solution) Is this a job for pyQuery?

    Read the article

  • xPath insert before and after - With DOM and PHP

    - by Jens Törnell
    I need to add a class to a HTML structure. My class is called "container" and should start right after div/ul/li (the child of ul and its simblings, not grandchilds) and should end right before the closing of the same element. My whole code looks like this: <?php $content = ' <div class="sidebar-1"> <ul> <li> <h4>Title</h4> <ul> <li><a href="http://www.test.com">Test</a></li> <li><a href="http://www.test.com">Test</a></li> </ul> </li> <li> <p>Paragraf</p> </li> <li> <h4>New title</h4> <ul> <li>Some text</li> <li>Some text åäö</li> </ul> </li> </ul> </div> '; $doc = new DOMDocument(); $doc->loadHTML($content); $x = new DOMXPath($doc); $start_text = '<div class="container">'; $end_text = '</div>'; foreach($x->query('//div/ul/li') as $anchor) { $anchor->insertBefore(new DOMText($start_text),$anchor->firstChild); } echo $doc->saveXML($doc->getElementsByTagName('ul')->item(0)); ?> It works as far as i can add the class opening but not the closing element. I also get strange encoding doing this. I want the output to be the same encoding as the input. The result should be <div class="sidebar-1"> <ul> <li> <div class="content"> <h4>Title</h4> <ul> <li><a href="http://www.test.com">Test</a></li> <li><a href="http://www.test.com">Test</a></li> </ul> </div> </li> <li> <div class="content"> <p>Paragraf</p> </div> </li> <li> <div class="content"> <h4>New title</h4> <ul> <li>Some text</li> <li>Some text åäö</li> </ul> </div> </li> </ul> </div>

    Read the article

  • Query for value where a default namespace node exists

    - by Jay
    I have the following XML that is provided to me and I cannot change it: <Parent> <Settings Version="1234" xmlns="urn:schemas-stuff-com"/> </Parent> I am trying to retrieve the "Version" attribute value using XPath. It appears since the xmlns is defined without an alias it automatically assigns that xmlns to the Settings node. When I read this XML into an XMLDocument and view the namespaceURI value for the Settings node it is set to "urn:schemas-stuff-com". I have tried: //Parent/Settings/@Version - returns Null //Parent/urn:schemas-stuff-com:Settings/@Version - invalid syntax

    Read the article

  • getTextContent from Node with whitespace character normalization

    - by Nayn
    Hi, I am working with XPATH, Java and want to extract some text out of one html page. The text is located under some div with some whitespace characters in between, like &nbsp; <br> etc. I want these to be converted into 'space' and 'newline' respectively while extracting. The method I am using to extract text is Element.getTextContent() which does not respect whitespace characters. Could somebody tell me if there is a way to extract text with whitespace normalization OR Extract whole html markup under the 'Node' so that i could replace it by myself. Thanks Nayn

    Read the article

  • Using java provided parameters into xpath function while applying xslt transformation

    - by filmac
    I'm working at a java application that performs some xslt transformation. I would like to match nodes into the xslt document, using a parameter provided by java. Which is the right way to do something like: <xsl:template match="//m:properties/*[contains($pattern,name())]"> because when I launch my application, it claims it's not able to compile the stylesheet, since pattern is not defined but I'm setting it using the setParameter method and I was able to use another parameter defined in the same way but in a different context. Thanks in advance Fil

    Read the article

  • Sum of XML duration elements in SQL2008

    - by Matt
    I have a XML column that holds information about my games. Here's a sample of the information looks like. <game xmlns="http://my.name.space" > <move> <player>PlayerA</player> <start movetype="Move">EE5</start> <end movetype="Move">DF6</end> <movetime>PT1S</movetime> </move> <move> <player>PlayerB</player> <start movetype="Move">CG7</start> <end movetype="Move">DE6</end> <movetime>PT3S</movetime> </move> <move> <player>PlayerA</player> <start movetype="Move">FD3</start> <end movetype="Move">EG8</end> <movetime>PT4S</movetime> </move> </game> I'm trying to design an XML query to take the sum of my movetime element. Basically I need the sum of each players move time. So using the above sample, PlayerA would have a total move time of 5 seconds and PlayerB would have a total move time of 3 seconds. Here's the XML query that I've been currently been working with SELECT GameHistory.query('declare default element namespace "http://my.name.space"; data(/game/move/movetime)') AS Value FROM GamesWHERE Id=560 I'm a newbie to XSLT / XPATH functions :P

    Read the article

  • Cannot install XML::LibXML module on Windows

    - by Deepak Konidena
    I am trying to use XPath to extract some HTML tags and data and for that I need to use XML::LibXML module. I tried installing it from CPAN shell but it doesn't install. I followed the instructions from CPAN site about the installation, that we need to install libxml2, iconv and zlib wrappers before installing XML::LibXML and it didn't work out. Also, if there is any other simpler module that gets my task done, please let me know. The task at hand: I am searching for a specific <dd> tag on a html page which is really big ( around 5000 - 10000) <dd> and <dt> tags. So, I am writing a script which matches the content within <dd> tag and fetches the content within the corresponding (next) <dt> tag. I wish i could i have been a little more clearer. Any help is greatly appreciated.

    Read the article

  • Is there a way to get YQL to return HTML?

    - by Joe Shaw
    I am trying to use YQL to extract a portion of HTML from a series of web pages. The pages themselves have slightly different structure (so a Yahoo Pipes "Fetch Page" with its "Cut content" feature does not work well) but the fragment I am interested in always has the same class attribute. If I have an HTML page like this: <html> <body> <div class="foo"> <p>Wolf</p> <ul> <li>Dog</li> <li>Cat</li> </ul> </div> </body> </html> and use a YQL expression like this: SELECT * FROM html WHERE url="http://example.com/containing-the-fragment-above" AND xpath="//div[@class='foo']" what I get back are the (apparently unordered?) DOM elements, where what I want is the HTML content itself. I've tried SELECT content as well, but that only selects textual content. I want HTML. Is this possible?

    Read the article

  • Parsing SOAP XML in Oracle

    - by user258587
    Hi I am new to Oracle and I am working on something that needs to parse a SOAP request and save the address to DB Tables. I am using the XML parser in Oracle (XMLType) with XPath but am struggling since I can't figure out the way to parse the SOAP request because it has multiple namespaces. Could anyone give me an example? Thanks in advance!!! edit It would be a typical SOAP request similar to the one below. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.service.****.com"> <soapenv:Header /> <soapenv:Body> <soap:UpdateElem> <soap:request> <soap:att1>123456789</soap:att1> <soap:att2 xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> <soap:att3>L</soap:att3> ..... </soap:request> </soap:UpdateElem> </soapenv:Body> </soapenv:Envelope> I need to retrieve parameters att1, att2... and save them in to a DB table.

    Read the article

  • pass object from JS to PHP and back

    - by Radu
    This is something that I don't think can't be done, or can't be done easy. Think of this, You have an button inside a div in HTML, when you click it, you call a php function via AJAX, I would like to send the element that start the click event(or any element as a parameter) to PHP and BACK to JS again, in a way like serialize() in PHP, to be able to restore the element in JS. Let me give you a simple example: PHP: function ajaxCall(element){ return element; } JS: callbackFunction(el){ el.color='red'; } HTML: <div id="id_div"> <input type="button" value="click Me" onClick="ajaxCall(this, callbackFunction);" /> </div> So I thing at 3 methods method 1. I can give each element in the page an ID. so the call to Ajax would look like this: ajaxCall(this.id, callbackFunction); and the callback function would be: document.getElementById(el).color='red'; This method I think is hard, beacause in a big page is hard to keep track of all ID's. method 2. I think that using xPath could be done, If i can get the exact path of an element, and in the callback function evaluate that path to reach the element. This method needs some googling, it is just an ideea. method 3. Modify my AJAX functions, so it retain the element that started the event, and pass it to the callback function as argument when something returns from PHP, so in my AJAX would look like this: eval(callbackFunction(argumentsFromPhp, element)); and the callback function would be: callbackFunction(someArgsFromPhp, el){ el.color='red'; // parse someArgsFromPhp } I think that the third option is my choise to start this experiment. Any of you has a better idea how I can accomplish this ? Thank you.

    Read the article

  • Strangely structured xml code finding last value of a certain type using java

    - by Damien.Bell
    Thus the structure is something like this: OasisReportMessagePayloadRTOReport_ItemReport_Data Under report data it's broken into categories: >>Zone >>Type >>Value >>Interval What I need to do is: Get the value if the type is equal to 'myType' and the interval value is the LARGEST. So an example of the xml might be (under report_data): OasisReport MessagePayload RTO REPORT_ITEM REPORT_DATA <zone>myZone1</zone> -- This should be the same in all reports since I only get them for 1 zone <type>myType</type> --This can change from line to line <value>12345</value>--This changes every interval <Interval>122</Interval> -- This is essentially how many 5 minute intervals have taken place since the beginning of a day, finding the "max" lets me know it's the newest data. Thereby I want to find stuff of "MyType" for the "max" interval and pull the Value (into a string, or a double, if not I can convert from string. Can someone help me with this task? Thanks! Note: I've used Xpath to handle things like this in the past, but it seems outlandish for this... as it's SO complex (since not all the reports live in the same report_item, and not all the types are the same in each report)

    Read the article

  • Transform RSS-Feed into another "standard" XML-Format with PHP

    - by ChrisBenyamin
    Hey friends, quick question: I need to transform a default RSS Structure into another XML-format. The RSS File is like.... Name des RSS Feed Feed Beschreibung de http://xml-rss.de Sat, 1 Jan 2000 00:00:00 GMT Titel der Nachricht Die Nachricht an sich http://xml-rss.de/link-zur-nachricht.htm Sat, 1. Jan 2000 00:00:00 GMT 01012000-000000 Titel der Nachricht Die Nachricht an sich http://xml-rss.de/link-zur-nachricht.htm Sat, 1. Jan 2000 00:00:00 GMT 01012000-000000 Titel der Nachricht Die Nachricht an sich http://xml-rss.de/link-zur-nachricht.htm Sat, 1. Jan 2000 00:00:00 GMT 01012000-000000 ...and I want to extract only the item-elements (with childs and attributes) XML like: <?xml version="1.0" encoding="ISO-8859-1"?> <item> <title>Titel der Nachricht</title> <description>Die Nachricht an sich</description> <link>http://xml-rss.de/link-zur-nachricht.htm</link> <pubDate>Sat, 1. Jan 2000 00:00:00 GMT</pubDate> <guid>01012000-000000</guid> </item> ... It hasn't to be stored into a file. I need just the output. I tried different approaches with DOMNode, SimpleXML, XPath, ... but without success. Thanks chris

    Read the article

  • Choose a XML node in SQL Server based on max value of a child element

    - by Jay
    I am trying to select from SQL Server 2005 XML datatype some values based on the max data that is located in a child node. I have multiple rows with XML similar to the following stored in a field in SQL Server: <user> <name>Joe</name> <token> <id>ABC123</id> <endDate>2013-06-16 18:48:50.111</endDate> </token> <token> <id>XYX456</id> <endDate>2014-01-01 18:48:50.111</endDate> </token> </user> I want to perform a select from this XML column where it determines the max date within the token element and would return the datarows similar to the result below for each record: Joe XYZ456 2014-01-01 18:48:50.111 I have tried to find a max function for xpath that would all me to select the correct token element but I couldn't find one that would work. I also tried to use the SQL MAX function but I wasn't able to get it working with that method either. If I only have a single token it of course works fine but when I have more than one I get a NULL, most likely because the query doesn't know which date to pull. I was hoping there would be a way to specify a where clause [max(endDate)] on the token element but haven't found a way to do that. Here is an example of the one that works when I only have a single token: SELECT XMLCOL.query('user/name').value('.','NVARCHAR(20)') as name XMLCOL.query('user/token/id').value('.','NVARCHAR(20)') as id XMLCOL.query('user/token/endDate').value(,'xs:datetime(.)','DATETIME') as endDate FROM MYTABLE

    Read the article

  • Is it possible to navigate to the parent node of a matched node during XSLT processing?

    - by Darin
    I'm working with an OpenXML document, processing the main document part with some XSLT. I've selected a set of nodes via <xsl:template match="w:sdt"> </xsl:template> In most cases, I simply need to replace that matched node with something else, and that works fine. BUT, in some cases, I need to replace not the w:sdt node that matched, but the closest w:p ancestor node (ie the first paragraph node that contains the sdt node). The trick is that the condition used to decide one or the other is based on data derived from the attributes of the sdt node, so I can't use a typical xslt xpath filter. I'm trying to do something like this <xsl:template match="w:sdt"> <xsl:choose> <xsl:when test={first condition}> {apply whatever templating is necessary} </xsl:when> <xsl:when test={exception condition}> <!-- select the parent of the ancestor w:p nodes and apply the appropriate templates --> <xsl:apply-templates select="(ancestor::w:p)/.." mode="backout" /> </xsl:when> </xsl:choose> </xsl:template> <!-- by using "mode", only this template will be applied to those matching nodes from the apply-templates above --> <xsl:template match="node()" mode="backout"> {CUSTOM FORMAT the node appropriately} </xsl:template> This whole concept works, BUT no matter what I've tried, It always applies the formatting from the CUSTOM FORMAT template to the w:p node, NOT it's parent node. It's almost as if you can't reference a parent from a matching node. And maybe you can't, but I haven't found any docs that say you can't Any ideas?

    Read the article

  • How can I get a Node adjacent to a unique Node using Scala?

    - by pr1001
    I'm trying to parse an Apple plist file and I need to get an array Node within it. Unfortunately its only unique identifier is sibling Node right before it, <key>ProvisionedDevices</key>. Right now my best thoughts are to use Java's XPATH querying or Node.indexOf. Here is an example: <plist version="1.0"> <dict> <key>ApplicationIdentifierPrefix</key> <array> <string>RP8CBF4MRE</string> </array> <key>CreationDate</key> <date>2010-05-10T11:44:35Z</date> <key>DeveloperCertificates</key> <array> ... <key>ProvisionedDevices</key> <array> ... // I need the Nodes here </array> </dict> </plist> Thanks!

    Read the article

  • All X elements below Y, but before another, descendent, Y

    - by JPM
    <div n="a"> . . . . . . <spec>red</spec> <spec>green</spec> . . . <div n="b"> . . . <spec>blue</spec> . . . </div> <div n="c"> <spec>yellow</spec> </div> . . . . . . . . . </div> When the current element is <div n="a">, I need an XPATH expression that returns the red and green elements, but not the blue and yellow ones, as .//spec does. When the current element is <div n="b">, the same expression needs to return the blue element; when <div n="c">, the yellow element. Something like .//spec[but no further than another div if there is one]

    Read the article

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