>I do not know how xpath2.0 coul help Im stating this from memory (so i should have probably checked) but xpath 2.0 had something called string-join that if I remember correctly could work on nodesets to concatenate values (As opposed to the concat function that would only pick one value) >. if i could write XQUERY instead of the xpath Then you might as well write some java in beanshell that can read the variables(from the Xpath extractor) to concatenate and form a single string that can be used. regards deepak
On Thu, Feb 17, 2011 at 5:00 AM, papa nagy <[email protected]> wrote: > I do not know how xpath2.0 coul help, becouse xpath is about extracting > info > from xml, not creating new one. if i could write XQUERY instead of the > xpath > expression, that could help! maybee saxon suports it transparently, i will > try that later! > > thx for advice, i will report my findings. > > On Mon, Feb 14, 2011 at 12:30 AM, sebb <[email protected]> wrote: > > > On 13 February 2011 23:19, Deepak Shetty <[email protected]> wrote: > > > Hi > > >>do you know another way making string concat and deal with strange > > > incremental variable names (like extracteid_154 )? > > > The for-each controller can deal with variables of this type - but you > > get > > > the result only one value at a time. > > > However for concatenation you probably need a script. (I dont think > > Jmeter > > > supports Xpath 2.0 functions but I might be mistaken) > > > > JMeter does not implement XPath directly, it relies on the library files. > > By default JMeter includes xalan_2.7.1, but of course you can replace > > that if you wish. > > > > If you know how many variables there are, then of course you can just > > concatenate them yourself: > > > > ${V1}${V2}...${Vn} > > > > > regards > > > deepak > > > > > > > > > > > > On Fri, Feb 11, 2011 at 11:43 AM, papa nagy <[email protected]> > > wrote: > > > > > >> i definded the query > > >> //@id > > >> and variable name > > >> extracedid > > >> in XPath Extractor > > >> > > >> in the debug sampler it shows up like: > > >> $extractedid=d3e9 > > >> $extractedid_1=d3e3 > > >> $extractedid_10=d3e5 > > >> $extractedid_100=d3e6 > > >> $extractedid_101=d3e7 > > >> ... > > >> > > >> so for constructing my url "http://url.com/query?i=d3e4&i=XXX..." > i > > >> would > > >> have to script again > > >> > > >> > > >> do you know another way making string concat and deal with strange > > >> incremental variable names (like extracteid_154 )? > > >> > > >> On Fri, Feb 11, 2011 at 8:10 PM, Deepak Shetty <[email protected]> > > wrote: > > >> > > >> > >as far as i know this is not possible with xpath, prove me wrong! > > >> > it works . use the XPath Extractor , specify your expression, add a > > >> DEBUG > > >> > sampler and check in view results tree listener. You will see > > multiple > > >> > values. > > >> > > > >> > >"$ctx" gives me an error), and how can i push variables back into > the > > >> > jmeter context. > > >> > In scripting languages like Beanshell / javascript use the vars > object > > >> for > > >> > variables . i dont know how to this with XSL as your language . If > its > > >> > possible , it would be possible only by using Java extensions. > > >> > > > >> > regards > > >> > deepak > > >> > > > >> > On Fri, Feb 11, 2011 at 11:02 AM, papa nagy <[email protected]> > > >> wrote: > > >> > > > >> > > thx for replying soon, > > >> > > > > >> > > i want to extract MULTIPLE id-s from one sample and want to build > a > > >> > string > > >> > > for use in consequent samplers(i=23423&i=134324&i=32543...). > > >> > > > > >> > > as far as i know this is not possible with xpath, prove me wrong! > > >> > > > > >> > > yes i want to ask in the general, how can I read the input > variables > > >> > (using > > >> > > "$ctx" gives me an error), and how can i push variables back into > > the > > >> > > jmeter > > >> > > context. > > >> > > > > >> > > maybee i should look to do it with javascript+DOM or XSL, but i > find > > it > > >> > too > > >> > > hard programming inside jmeter! if somebody knows how to use this > > stuff > > >> i > > >> > > would prefer xslt becouse i consider it much simpler. > > >> > > > > >> > > On Fri, Feb 11, 2011 at 7:08 PM, Deepak Shetty <[email protected] > > > > >> > wrote: > > >> > > > > >> > > > hi > > >> > > > if all you want to do is select an id then use the XPATH > > extractor. > > >> > > > > > >> > > > If you want to ask this in the general case , then I believe you > > will > > >> > > have > > >> > > > to use a scripting language that can run an XSL transform and > > which > > >> can > > >> > > > also > > >> > > > interact with the JMeter variables instead of using xsl as the > BSF > > >> > > > language. > > >> > > > > > >> > > > It might also be possible to use XSLT enhancements (which can > call > > >> java > > >> > > > code), but Im not sure > > >> > > > > > >> > > > regards > > >> > > > deepak > > >> > > > > > >> > > > On Fri, Feb 11, 2011 at 8:38 AM, papa nagy < > [email protected]> > > >> > wrote: > > >> > > > > > >> > > > > hi, > > >> > > > > > > >> > > > > I am trying to use the BSF PostProcessor with a basic XSLT > > Script! > > >> it > > >> > > > runs > > >> > > > > without errors but I dont know how to read sample data nor to > > ouput > > >> > > > > something in a variable. > > >> > > > > > > >> > > > > I found one exaple using this postprocessor with javascript > > >> > > > > > > >> > > > > http://www.havecomputerwillcode.com/blog/?p=500 > > >> > > > > > > >> > > > > but cannot find code using xslt, maybee somebody used it > > before... > > >> > > > > > > >> > > > > this is my xslt, extracting id-attributes: > > >> > > > > > > >> > > > > <?xml version="1.0" encoding="UTF-8"?> > > >> > > > > <xsl:stylesheet version="1.0" xmlns:xsl=" > > >> > > > > http://www.w3.org/1999/XSL/Transform" > > > >> > > > > > > >> > > > > <xsl:output method="text" version="1.0" encoding="UTF-8" > > >> > indent="yes"/> > > >> > > > > > > >> > > > > <xsl:template match="/"> > > >> > > > > <xsl:value-of select="//*/@id"/> > > >> > > > > </xsl:template> > > >> > > > > > > >> > > > > </xsl:stylesheet> > > >> > > > > > > >> > > > > > >> > > > > >> > > > >> > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > >

