Subject: Re: [xsl] XSL - parsing a delimited string (URL) From: web138p1 <web138p1@xxxxxxxxxxxxxxx> Date: Thu, 23 Dec 2010 14:52:18 +0100 |
> I have an XML element that might might be empty or might contain: > ;#http://www.blah.com/blah/blah2/blah.doc;# or: > > ;#http://www.blah.com/blah/blah3/blah.doc;#http://www.blah.com/blah/blah/blah.doc;# > > How do I tokenize the string so that I can get only that first occurrence? > That is, only the first URL (if any) between the delimiters ... ? Only first occurence ==> no recursion needed. $ cat data.xml <data>;#http://www.blah.com/blah/blah3/blah.doc;#http://www.blah.com/blah/blah4/blah.doc;#</data> $ $ xpath++ "substring-before(concat(substring-after(.,';#'),';#'),';#')" data.xml http://www.blah.com/blah/blah3/blah.doc $ Mit besten Gruessen / Best wishes, Hermann Stamm-Wilbrandt Developer, XML Compiler, L3 Fixpack team lead WebSphere DataPower SOA Appliances ---------------------------------------------------------------------- IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSL - parsing a delimited, Michael Kay | Thread | [xsl] Dynamic dispatch of functions, David Lee |
Re: [xsl] Novice Question - matchin, Michael Kay | Date | [xsl] Dynamic dispatch of functions, David Lee |
Month |