Concatenate multiple instance of the qualified string - xslt-1.0

Based on the given xpath below I need to concatenate all of instance that will satisfy on below xpath condition (with space in between string). Thanks in advance.
ShippingOrder/ShipmentInformation/Instructions[ProprietaryShippingInstructionsCode
= 'HTZS08']/notes/FreeFormText

Related

Regex for extracting certain information from a string

Below is the string that I have -
vdp_plus_forecast_aucc_VDP_20221024_variance_analysis_20221107_backcasting_actuals_asp_True_vlt_True.csv
I need RegEx to take out following items from the string -
20221107
vlt_True
Need help with writing right RegEx for these two extractions. I'm performing the operation on a PySpark DF.
I'm assuming that the answer is based on the variable in front of it so it's capturing the value of variance analysis:
(?<=_variance_analysis_)[0-9]+|vlt_(True|False)
This should capture the variables you wanted, if you only need the value of vlt, you can replace vlt_ with (?<=_vlt) which will just capture the value without the variable

What does this SQL query replacing JSON text mean?

I'm trying to understand a part of SQL query but I don't know what's it used for; can anyone help me?
I know it wants to replace something, but what is " ":"(.+)" ", and why the string like "store" can be used in substring()?
replace((
CASE
WHEN(char_length(substring(xxx_json::text FROM 'Name":"(.+)" , "store')) > 0)
THEN substring(xxx_json::text FROM 'Name":"(.+)" , "store')
ELSE substring(xxx_json::text FROM 'Name":"(.+)" , "employees')
END),'\u0016','''')
This appears to be a variant of substring that does regular-expression matching. The first argument, xxx_json::text, is the string to be searched. The second argument is the regular expression to match.
Note that the second argument consists of the entire SQL string literal 'Name":"(.+)" , "store' (in the first two cases). Everything in that string, except for the (.+), should literally match a portion of the string to be searched. The (.+) is regex syntax. A dot matches any character; a + means one or more occurrences; the parentheses define this as a capture group. In this context, the text that matches the capture group is what will be returned by substring.
So for instance if the contents of the string to be searched was a simple JSON expression like this: { "Name":"John Smith" , "store":"London" }, the regular expression would match and the substring would return 'John Smith'.
In short, this is a slightly hacky way of parsing JSON in SQL to extract the value of the Name element (or some element whose key ends with Name).
See section 9.7.3 in https://www.postgresql.org/docs/9.4/static/functions-matching.html for detailed documentation on this form of substring.

Build XPath using wildcard for changing strings

I am trying to build an XPath for a property that is constantly changing. The number prefix is bound to change sometimes.
Original:
//*[#id="MainContent_DXEditor3_I"]
which I can query using
$x('//*[#id="MainContent_DXEditor3_I"]
Intended use: I would like to build the string to handle any number in the sub-string. Example: if the property changes to 'MainContent_DXEditor33_I' or 'MainContent_DXEditor8_IXYZ' - I still want to be able to find the element without having to rebuild
You can try to relax the predicate by using starts-with() :
//*[#starts-with(#id, "MainContent_DXEditor")]
You should try to identify a unique parent of the element or save xpath as a string that contains a variable.
These are the 2 possible solutions.
A general selector will return multiple elements, if you identify a unique parent then you are closer and after that you can select any first, second.. last if you have a list.

Use single value of parameter List in queryString

I am using JasperStudio 5.6.0.final and the report is not generated dynamically from java code.
I have a problem with getting single value from parameter.
In the report I have a parameter A of a type List.
It is not a problem to use it in a clause as IN statement:
AND $X{IN, USER.ID_USER, A}
But I have a problem to get a single value from that list.
I know that my List has always 10 values.
So I want to use it in query, but I don't know how to write the statement:
AND USER.ID_USER = *first_value_of_list_A*
e.g.
AND USER.ID_USER = $P!{Atrybuty}.get(1)
doesn't work
I tried also to assign parameter value to a variable, but as I know it isn't possible to use variables in queryString.
So my question: How to get single value from parameter List in queryString.
What you need to do for this is use
AND $X{IN, USER.ID_USER, A}
Set A type as Collection and that will allow you to even have a single selection or multi selection or just a single value.
Hope that this helps.

extract substring doesn't work on lookup field -sharepoint 2010

When I try to extract a substring from a lookup field in list I don't get nothing (using a workflow) when I use nonlookup field it works.
Any idea of how to fix this. what I am missing.
Use the class SPFieldLookupValue.
You can use the two properties LookupValue and LookupId to extract values from the field, there is no other need to extract the substring.
SPFieldLookupValue lookup = new SPFieldLookupValue(item["fieldName"] as string);
lookup.LookupValue;
lookup.LookupId;
Hope this helps.