Welcome to WebmasterWorld Guest from 54.242.53.253

Forum Moderators: httpwebwitch

Message Too Old, No Replies

removing trailing space in xml elements.

<element> value </element>

     
6:08 am on Jul 13, 2011 (gmt 0)

New User

5+ Year Member

joined:July 13, 2011
posts:2
votes: 0


Hi,
I am getting an xml file like this.

<House>
<Refrigirator> Whirlpool </Refrigirator>
<Washing Machine> Samsung</Washing Machine>
<TV> Samsun TV </TV>
<cooler> L G </cooler>
</House>

I have to get the output with out trailing spaces in the XMl elements. No schema restrictions has to be applied on this xml file only either with XSLT/Xquery or any other which suits to this I have to use.


<House>
<Refrigirator>Whirlpool</Refrigirator>
<Washing Machine>Samsung</Washing Machine>
<TV>Samsun TV</TV>
<cooler>L G</cooler>
</House>




Thanks.
6:22 am on July 13, 2011 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 30, 2002
posts:4843
votes: 2


Welcome to the forums reachparrot,

removing trailing space in xml elements


Is there any particular scripting language you work with? There are a ton of solutions, it really depends what you work with...
6:42 am on July 13, 2011 (gmt 0)

New User

5+ Year Member

joined:July 13, 2011
posts:2
votes: 0


working with OSB (Oracle Service Bus), I have to give this XMl as a input to eiter XSL/Xquery and to get back the XMl with out trailing spaces.
7:12 am on July 13, 2011 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 30, 2002
posts:4843
votes: 2


Not really familiar with it but perhaps you've not seen this function list? There are options for trimming strings in there.

[download.oracle.com...]
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members