xml-parsing

Groovy XMLSlurper - searching sepecific node

十年热恋 提交于 2019-12-11 08:44:30
问题 I need to find a specific node with Groovy's XMLSlurper. The condition should be that the text/value of the children nodes have to match. In the following example I want to search for a book node where the year is '2003' and the price is '39.95'. <bookstore name="Store A"> <employee> <id>546343</id> <name>Dustin Brown</name> </employee> <employee> <id>547547</id> <name>Lisa Danton</name> </employee> <book category="cooking"> <title lang="en">Everyday Italian</title> <author>Giada De

google app script Exceeded memory limit

北慕城南 提交于 2019-12-11 08:38:57
问题 May be this question already asked, but that won't solve my problem. I try to save data's into google spreadsheet using google app script . But it shows Exceeded memory limit error. following my code: //new function getNewTitle() { var url = "https://www.reddit.com/r/DigitalMarketing.rss?limit=100&after=0"; var fromText = '</updated><title>'; var toText = '</title>'; var content = UrlFetchApp.fetch(url).getContentText(); var scraped = Parser.data(content).from(fromText).to(toText).iterate();

Add new node in XML file

女生的网名这么多〃 提交于 2019-12-11 08:35:12
问题 I have a xml file with a structure like this: <?xml version="1.0"?> <entries> <entry accente="one"> <list>Word</list> <sense class="0" value="B"> <definition> <MorfDef>s. m.</MorfDef> <RegDef>This <i>text</i> have i node.</RegDef> <ItalMarker>Text.</ItalMarker> </definition> </sense> </entry> <entry accente="two"> <list>B n-1</list> <sense class="0" value="B"> <definition> <MorfDef>s. m.</MorfDef> <RegDef>This text doesn't have i atribute.</RegDef> <ItalMarker>Word.</ItalMarker> </definition>

How to parse XML using XSLT?

回眸只為那壹抹淺笑 提交于 2019-12-11 08:27:57
问题 I have an XML with data as follows <Item1> <item2> <Item3>111</Item3> <Item2> </Item11> To get the value 111 in Item3 <xsl:choose> <xsl:value-of select="Item1/Item2/Item3"/> </xsl:choose> In XSLT . Now I need to get the following: <Product1> <Product2> <Product3 ValidYN="Y" ProducType="ABC">333</Product3> <Product3 ValidYN="Y" ProducType="DEF">444</Product3> <Product3 ValidYN="Y" ProducType="GHI">555</Product3> <Product12> </Product1> I need to take values 333 , 444 , 555 based on ProducType

jQuery xml parse with check for IE8 not working

本小妞迷上赌 提交于 2019-12-11 08:26:51
问题 I have looked through and tried all the SO answers on jQuery, XML and IE8, but nothing is giving me a result. Any other suggestions on how to get this to working with jQuery or Javascript? $.ajax({ type: "GET", url: "http://query.yahooapis.com/v1/public/yql?q=select%20title%2C%20link%20from%20rss%20where%20url%3D%22http%3A%2F%2Fwww.fs.usda.gov%2Fwps%2FPA_WIDConsumption%2Frssgetfile%3FxFSENavChannel00%3D1109%26xFSENavChannel02%3D091000000000000%26pathinfo%3D%2Fwps%2Fportal%2Ffsinternet%2F!ut

Java spring XML binding based on conditions using JAXB

牧云@^-^@ 提交于 2019-12-11 08:06:04
问题 I am binding XML to object using JAXB, is it possible to bind based on conditions such as Bind href attribute in api:page element where attribute position is equal to next . Or get all records as standard list and then filter out by using if condition <api:pagination results-count="93" items-per-page="25"> <api:page position="this" href="https://url1.com" /> <api:page position="next" href="https://url1.com?pid=2" /> </api:pagination> 回答1: It is not necessary to make a transformation for such

XSLT - retrieving an XMl tag value without its inner tags

自古美人都是妖i 提交于 2019-12-11 08:04:37
问题 I have an xml that looks like this: <OuterTag> outerVal <Name> value1 </Name> <Desc> value2 </Desc> </OuterTag> and I want to retrieve the value of the outer tag ("outerVal"). when I use xsl:value-of select="OuterTag" /> I get "outerValvalue1value2". How can i retrieve only the outer value? 回答1: A complete solution: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output omit-xml-declaration="yes" method="text"/> <xsl:template match="/"> <xsl:value-of

Receive xml file is corrupted (on sprint network)?

我的梦境 提交于 2019-12-11 07:51:08
问题 I am having a very strange issue in my android app. I receive xml file from server and perform operation based on xml content. It is working on almost every network for eg. AT&T, Verizon in USA, airtel, vodaphone and others in india.But it not working on sprint network USA. When i tried to find xml content i am getting some byte code or unicode not the plain xml file. I looked for more information i found other also has faced this issue on sprint evdeo. people says turn off byte mobile

How to parse multi record XML file ues XML::Simple in Perl

拈花ヽ惹草 提交于 2019-12-11 07:19:28
问题 My data.xml <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd country="UK"> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <price>10.0</price> </cd> <cd country="CHN"> <title>Greatest Hits</title> <artist>Dolly Parton</artist> <price>9.99</price> </cd> <cd country="USA"> <title>Hello</title> <artist>Say Hello</artist> <price>0001</price> </cd> </catalog> my test.pl #!/usr/bin/perl # use module use XML::Simple; use Data::Dumper; # create object $xml = new XML::Simple; #

Getting the element name of an attribute in xml using powershell

老子叫甜甜 提交于 2019-12-11 07:00:56
问题 I would like to get the node name of an attribute using powershell. Can anyone please let me know if we have a built in function for the same. Following is my xml file called pricefile.xml <model type="model1" name="default" price="12.12" date="some_value"> <PriceData> <item name="watch" price="24.28" date="2013-12-01"/> <item name="toy" price="22.34" date="2013-12-02"/> <item name="bread" price="24.12" date="2013-12-03"/> </PriceData> </model> Say I want to get the element name "item" for