Removing xml element and strip extra space

2014-07-22 Thread varun bhatnagar
Hi, I am trying to play around with python and xslt. I have an xml and I want to transform it to another xml by deleting its one element. The xml is pasted below: ?xml version=1.0 encoding=UTF-8? testNode nodeInfo nodePeriod nodeTime=6/ nodeBase base=0 / /nodeInfo

Re: Removing xml element and strip extra space

2014-07-22 Thread Monte Milanuk
On 2014-07-22, varun bhatnagar varun292...@gmail.com wrote: I want to strip the space between *nodePeriod* and */nodeInfo* Can anyone suggest a way out to do that? Look at str.rstrip() - by default it removes trailing whitespace including carriage returns. --

Re: Removing xml element and strip extra space

2014-07-22 Thread varun bhatnagar
Hi, Thank you so much for the suggestion. I tried using the rstrip() function but that did not work. Still getting a blank space between *nodePeriod* and */nodeInfo *as mentioned in the above output xml file: *nodePeriod nodeTime=6/* * /nodeInfo* Is there any other way through which

Re: Removing xml element and strip extra space

2014-07-22 Thread Tim
On Tuesday, July 22, 2014 8:53:35 AM UTC-4, varun bhatnagar wrote: Hi, Thank you so much for the suggestion. I tried using the rstrip() function but that did not work. Still getting a blank space between nodePeriod and /nodeInfo as mentioned in the above output xml file: nodePeriod

Re: Removing xml element and strip extra space

2014-07-22 Thread varun bhatnagar
Hi Tim, Thanks for replying. No that is not the output I am looking for. I just want to scrape out nodeBase base=0 / But the way I have written my xsl file it is removing it but it is also leaving a blank space there. I want my output to look like this: *?xml version=1.0

Re: Removing xml element and strip extra space

2014-07-22 Thread Monte Milanuk
On 2014-07-22, varun bhatnagar varun292...@gmail.com wrote: I just want to scrape out nodeBase base=0 / But the way I have written my xsl file it is removing it but it is also leaving a blank space there. I want my output to look like this: This is the part where a certain amount of example