We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

parse a string using a delimeter in xml

jrbledsoe001
jrbledsoe001 asked
on
Medium Priority
453 Views
Last Modified: 2012-05-11
Hello,  

I'm a newbie to web programming and I'm sure glad I found this site.

I have a string which I want to parse into 4 segments using a dash "-" as a delimeter.  Here is a sample data element:  ItemUpdate-HOSP-99998-C.  My data is contained in an xml string:  <!qry_wfw_WORK_TITLE>.  I know how to parse the xml string using a substring function; example <!qry_wfw_WORK_TITLE.substr(16, 5)> returns "99998".  How would I split the data into 4 different fields using a dash as a delimeter?  In other tools I would use a split function such as lsplt([field name], 4, "-", 3) where the function uses the delimeter "-" and returns the 3rd segment.
Comment
Watch Question

Michel PlungjanIT Expert
CERTIFIED EXPERT
Top Expert 2009

Commented:
Hi

It is not clear to me what language you are using and where.

Is it inside XSL? because your syntax does not seems to match anything I have seen - like this for example


http://www.xml.com/lpt/a/962
Senior Software Engineer
CERTIFIED EXPERT
Top Expert 2009
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Hello mas oz2003!  I saw your reference to that url when I was researching my question.  Your comment information was all that I needed to understand how to use the string split method.  
I think this split method will work perfectly.  Thanks for providing an answer to my question!!!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.