Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74992
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <varun292006@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.040 |
| X-Spam-Evidence | '*H*': 0.92; '*S*': 0.00; 'output': 0.05; 'that?': 0.05; 'transform': 0.07; '<?xml': 0.09; 'subject:extra': 0.09; 'subject:xml': 0.09; 'python': 0.11; 'suggest': 0.14; 'element.': 0.16; 'thanks,': 0.17; 'trying': 0.19; '8bit%:5': 0.22; 'skip:e 30': 0.24; 'looks': 0.24; 'this:': 0.26; 'xml': 0.29; 'message- id:@mail.gmail.com': 0.30; 'strip': 0.31; 'anyone': 0.31; 'file': 0.32; 'skip:m 30': 0.32; 'another': 0.32; 'skip:& 30': 0.33; 'skip:s 30': 0.35; 'received:google.com': 0.35; 'hi,': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'skip:m 40': 0.38; 'to:addr :python-list': 0.38; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'space': 0.40; '8bit%:6': 0.40; 'how': 0.40; 'remove': 0.60; 'deleting': 0.60; 'skip:n 30': 0.60; 'tag': 0.61; 'between': 0.67; 'below:': 0.68; '\xc2\xa0\xc2\xa0': 0.74; 'url:1999': 0.75; 'br,': 0.84; 'subject:space': 0.84; '8bit%:18': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=564RxUHt7bLQKp3JeNlqXgImxEkwBK6CJ1dO1NoLrEQ=; b=C5XCkia9vjBig983YaZD7TT1IHhHywLCS3f5zG3DgKG4MIH1pZAamKwaKn5k5/l/Ou /nv3ERzkAHGNyVgS9hwNGok5yIif+FY54yx1f2GDTPXkI9OFAi+toGXxP4L8wuc4suoc W74sb1FHYJAVf4A7/2sCXhIltxznzrbp7c8vZgzsd1KkuIa1pLSFjY6/lEB0FU38g4Tp IgZFJLMBeovQgHuXSzPwGKmfCMdDYzc+CzIPDR779nRzLULtJtVhX9gXZc0mAD/6QHzn fBNgzb+iTYXBakcy6/AlnlCIb3SUGVgHax3zT4FEYCrnL2vvRsVaohbtLTsDprwAq3h6 jOQA== |
| MIME-Version | 1.0 |
| X-Received | by 10.236.83.103 with SMTP id p67mr39004591yhe.89.1406029106233; Tue, 22 Jul 2014 04:38:26 -0700 (PDT) |
| Date | Tue, 22 Jul 2014 13:38:26 +0200 |
| Subject | Removing xml element and strip extra space |
| From | varun bhatnagar <varun292006@gmail.com> |
| To | python-list@python.org |
| Content-Type | multipart/alternative; boundary=20cf301af2c36bc7b004fec6a942 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.12178.1406029458.18130.python-list@python.org> (permalink) |
| Lines | 139 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1406029458 news.xs4all.nl 2870 [2001:888:2000:d::a6]:54288 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:74992 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
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="600000000"/>
<nodeBase base="0" />
</nodeInfo>
</testNode>
I want to remove the <nodeBase> tag and this is how my xsl file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/testNode/nodeInfo/nodeBase">
</xsl:template>
</xsl:stylesheet>
When I execute it my output looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<testNode>
<nodeInfo>
* <nodePeriod nodeTime="600000000"/>*
* </nodeInfo>*
</testNode>
I want to strip the space between *<nodePeriod>* and *</nodeInfo>*
Can anyone suggest a way out to do that?
Thanks,
BR,
Varun
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Removing xml element and strip extra space varun bhatnagar <varun292006@gmail.com> - 2014-07-22 13:38 +0200
csiph-web