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
-- https://mail.python.org/mailman/listinfo/python-list