[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Extract String between chars
Thank you very much, David. On Tue, 26 Oct 2021 at 13:18, David Carlisle d.p.carlisle@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > This is the same as the case you asked the other day. > > Given input > > <x>Order1#11.11.11.111;Order2#22.22.22.22;Order3#333.3433.3333;</x> > > and stylseheet > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > > > <xsl:param name="n"/> > <xsl:template match="x"> > <xsl:value-of > select="substring-before(substring-after(.,concat($n,'#')),';')"/> > </xsl:template> > </xsl:stylesheet> > > > Then > > > $ saxon9 pp2.xml pp2.xsl n=1 > <?xml version="1.0" encoding="UTF-8"?>11.11.11.111 > > and > > $ saxon9 pp2.xml pp2.xsl n=3 > <?xml version="1.0" encoding="UTF-8"?>333.3433.3333 > > > > > On Tue, 26 Oct 2021 at 17:59, Prady Prady prady.chin@xxxxxxxxx < > xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > >> Team, >> >> I need a template for which, when I pass order number as parameter, I >> should get the corresponding IPs. I need this in *XSLT 1.0* >> >> =============== >> Eg >> Input String : >> Order1#11.11.11.111;Order2#22.22.22.22;Order3#333.3433.3333; >> Param : Order2 >> >> Output: >> 22.22.22.22 >> >> Basically it should extract text between # and ; after Order2 >> ================ >> >> Thank you very much for your help. >> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> >> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/2739265> (by >> email) >> > XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> > EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3397216> (by > email <>)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|