xsl-list
[Top] [All Lists]

Re: Replacing strings in XSL

2005-03-21 13:07:49
Thanks for your reply, i tried using this in my XSL.
It did not work the way i wanted it to.

My XML has <MANUFACTURER>LG Electronics
Inc</MANUFACTURER>
The output in the html format should be 

LG&nbsp;Electronics&nbsp;Inc. 

When i used what you have sent, i got the following
output, 
LGElectronicsInc

I don't see the &nbsp; inbetween. Please help me with
this.

Thanks
Preeti





JBryant(_at_)s-s-t(_dot_)com wrote:
That clears up the issue. I thought you might have a
structure like 
, which would be a different problem.

The following solutions work against this midget XML
structure:


one two three


One way to do what you want to do in XSLT 1.0 is this:












 

select="substring-after($inString, ' ')"/>








One way to do it in XSL 2.0 is this:




(Thanks to Dr. Kay for pointing out the replace
function earlier today.)

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution
Technologies)




preetig_2 
03/18/2005 04:05 PM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
cc

Subject
Re: [xsl] Replacing strings in XSL






Hi Jay,

My XML has a tag somewhat like this,

LG Electronics Inc 

The XSL has to replace the white spaces with  
For e.g: LG Electronics Inc

Hope that helps, please let me know if you have nay
questions.

Thanks,
Preeti 


I'm sure it is, but exactly how you'd want to go
about it is likely to 
depend on the details of what you are trying to do.
How about sending us 
snippets (small but complete enough to show the
problem) of your XML 
source, your stylesheet so far, and your desired
output. It's pretty hard 
to answer questions in a vacuum (at least for me).

Jay Bryant
Bryant Communicaton Services
(presently consulting at Synergistic Solution
Technologies)




preetig_2 
03/18/2005 03:07 PM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
cc

Subject
[xsl] Replacing strings in XSL






Hi ,

I am trying to replace white space with   .
Please let me know if its doable in XSL.

Thanks,
Preeti





__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

--~------------------------------------------------------------------
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail: 
--~--




--~------------------------------------------------------------------
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail: 
--~--




                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>