We use XSLT in data transformation and in one particular situation we might want to use same value for different fields. A variable in such case is a best approach one could think of. Below is the code snippet which is used in xslt in order to create and use a variable.
Below is a part of xslt which can be referred as an example,
<sch:ReceivedReturnCenter>
<xsl:value-of xmlns:sch="http://schemas.cordys.com/" select="concat(substring(/sch:ROConDTInput/sch:request/sch:GRDATE,7,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,5,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,1,4))" />
</sch:ReceivedReturnCenter>
<sch:SendBackToCustomer>
<xsl:value-of xmlns:sch="http://schemas.cordys.com/" select="concat(substring(/sch:ROConDTInput/sch:request/sch:GRDATE,7,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,5,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,1,4))" />
</sch:SendBackToCustomer>
Here both the target values "ReceivedReturnCenter" and "SendBackToCustomer" are mapped to a single value which is concatenation/substring of another field "GRDATE".
No doubt with this approach we would achieve the solution but its unnecessary to perform the same logic multiple times. Hence ideally we would be having the logic stored in a variable and use that variable to assign to both the target fields. Here is how we can do it,
<xsl:variable name="grDate">
<xsl:value-of xmlns:sch="http://schemas.cordys.com/" select="concat(substring(/sch:ROConDTInput/sch:request/sch:GRDATE,7,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,5,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,1,4))" />
</xsl:variable>
<sch:ReceivedReturnCenter>
<xsl:value-of select="$grDate" />
</sch:ReceivedReturnCenter>
<sch:SendBackToCustomer>
<xsl:value-of select="$grDate" />
</sch:SendBackToCustomer>
Usage of variable : $grDate
Note : There is a drawback of using variable in xslt as the same variable cannot be edited later (or I am not aware of :P). Variables in xslt are supposed to be initialized/assigned a value only once.
Below is a part of xslt which can be referred as an example,
<sch:ReceivedReturnCenter>
<xsl:value-of xmlns:sch="http://schemas.cordys.com/" select="concat(substring(/sch:ROConDTInput/sch:request/sch:GRDATE,7,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,5,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,1,4))" />
</sch:ReceivedReturnCenter>
<sch:SendBackToCustomer>
<xsl:value-of xmlns:sch="http://schemas.cordys.com/" select="concat(substring(/sch:ROConDTInput/sch:request/sch:GRDATE,7,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,5,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,1,4))" />
</sch:SendBackToCustomer>
Here both the target values "ReceivedReturnCenter" and "SendBackToCustomer" are mapped to a single value which is concatenation/substring of another field "GRDATE".
No doubt with this approach we would achieve the solution but its unnecessary to perform the same logic multiple times. Hence ideally we would be having the logic stored in a variable and use that variable to assign to both the target fields. Here is how we can do it,
<xsl:variable name="grDate">
<xsl:value-of xmlns:sch="http://schemas.cordys.com/" select="concat(substring(/sch:ROConDTInput/sch:request/sch:GRDATE,7,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,5,2),substring(/sch:ROConDTInput/sch:request/sch:GRDATE,1,4))" />
</xsl:variable>
<sch:ReceivedReturnCenter>
<xsl:value-of select="$grDate" />
</sch:ReceivedReturnCenter>
<sch:SendBackToCustomer>
<xsl:value-of select="$grDate" />
</sch:SendBackToCustomer>
Usage of variable : $grDate
Note : There is a drawback of using variable in xslt as the same variable cannot be edited later (or I am not aware of :P). Variables in xslt are supposed to be initialized/assigned a value only once.
I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
ReplyDeletedata science
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteData Analytics Course in Mumbai
Such a very useful article. Very interesting to read this article. I have learn some new information.thanks for sharing. ExcelR
ReplyDeleteI feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
ReplyDeleteExcelR Business Analytics Course
Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
ReplyDeleteData science
This is also a very good post which I really enjoyed reading. It is not every day that I have the possibility to see something like this.. best data science course in bangalore
ReplyDeleteReally impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing.
ReplyDeletedata analytics courses
data science interview questions
business analytics courses
data science course in mumbai
The information provided on the site is informative. Looking forward more such blogs. Thanks for sharing .
ReplyDeleteArtificial Inteligence course in Faridabad
AI Course in Faridabad
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
ReplyDeletedata analytics course in Bangalore
Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
ReplyDeleteSimple Linear Regression
Correlation vs Covariance
Great information!! Thanks for sharing nice blog.
ReplyDeleteData Science Course in Hyderabad
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
data science interview questions
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteSimple Linear Regression
Correlation vs Covariance
The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.data science course in Hyderabad
ReplyDeleteNumerous website admins are continually hoping to spare time by recruiting others to do physical work so they can concentrate more on promoting and refreshing their sites. database data entry services
ReplyDeleteI am really happy with your blog because your article is very unique and powerful for new reader.data science course in Hyderabad
ReplyDeleteVery nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data science online course
ReplyDeleteYour work is very good, and I appreciate you and hopping for some more informative posts
ReplyDelete<a href="https://www.excelr.com/business-analytics-training-in-pune/”> Courses in Business Analytics</a> have express a few of the articles on your website now, and I really like your style of blogging. I added it to my favorite’s blog site list and will be checking back soon…
I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job !
A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one.
ReplyDeletedata scientist course in hyderabad
New site is solid. A debt of gratitude is in order for the colossal exertion.
ReplyDeletedata scientist course in hyderabad
rastgele görüntülü konuşma - kredi hesaplama - instagram video indir - instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram beğeni satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - polen filtresi - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - webturkey.net - karfiltre.com - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir
ReplyDeleteaşk kitapları
ReplyDeleteyoutube abone satın al
cami avizesi
cami avizeleri
avize cami
no deposit bonus forex 2021
takipçi satın al
takipçi satın al
takipçi satın al
takipcialdim.com/tiktok-takipci-satin-al/
instagram beğeni satın al
instagram beğeni satın al
btcturk
tiktok izlenme satın al
sms onay
youtube izlenme satın al
no deposit bonus forex 2021
tiktok jeton hilesi
tiktok beğeni satın al
binance
takipçi satın al
uc satın al
sms onay
sms onay
tiktok takipçi satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
instagram beğeni satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
takipcialdim.com/instagram-begeni-satin-al/
perde modelleri
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
betboo
marsbahis
sultanbet
I was basically inspecting through the web filtering for certain data and ran over your blog. I am flabbergasted by the data that you have on this blog. It shows how well you welcome this subject. Bookmarked this page, will return for extra. data science course in jaipur
ReplyDeleteThe information in the post you posted here is useful because it contains some of the best information available. Thanks for sharing it. Keep up the good work Graphic Designing Services.
ReplyDeleteThanks for posting the best information and the blog is very good.business analytics course in udaipur
ReplyDeletemmorpg oyunlar
ReplyDeleteİNSTAGRAM TAKİPCİ SATİN AL
TİKTOK JETON HİLESİ
TİKTOK JETON HİLESİ
antalya saç ekimi
instagram takipçi satın al
INSTAGRAM TAKİPCİ SATİN AL
Mt2 Pvp
instagram takipçi satın al
üsküdar vestel klima servisi
ReplyDeletekartal daikin klima servisi
ümraniye daikin klima servisi
beykoz toshiba klima servisi
üsküdar toshiba klima servisi
beykoz beko klima servisi
üsküdar beko klima servisi
çekmeköy lg klima servisi
ataşehir daikin klima servisi
özel ambulans
ReplyDeleteen son çıkan perde modelleri
yurtdışı kargo
uc satın al
nft nasıl alınır
en son çıkan perde modelleri
lisans satın al
minecraft premium
ReplyDeleteThis blog consistently delivers high-quality content on data science topics. Kudos to the author!
Data Science training In Faridabad
A clever method for data transformation in XSLT is the use of variables. By utilizing the same logic again and again, like in your case, it optimizes code. Just keep in mind that once set, XSLT variables cannot be changed. Great advice!👍
ReplyDeleteData Analytics Courses in India
Thanks for the informative post on using variables in XSLT. It's a great way to avoid repeating the same logic multiple times, and it's good to know about the limitation of not being able to edit variables later.
ReplyDeleteData Analytics Courses in Nashik
Your explanation of using variables in XSLT for data transformation is incredibly helpful! It's a smart and efficient way to avoid unnecessary repetition of the same logic, and your clear example makes it easy for readers to understand and implement. Great job simplifying the process! 💡👏 #XSLT #DataTransformation #CodingEfficiency
ReplyDeleteData Analytics Courses in Mumbai
Navigating through the intricate landscape of XSLT data has never felt more like unlocking hidden pathways. This post shines a light on variables, turning the complex into a playground of understanding. It's like having a secret key to transform data sorcery into a dance of logic.
ReplyDeletedata Analytics courses in lisbon