XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Nicholas PeekeSubject: remove empty xml tags
Author: Nicholas Peeke
Date: 13 Feb 2003 01:41 PM
I'm a little new to XSL and is there a simple way in the XML-to-XML mapper to remove empty XML tags in an XML to XML transform?

instead of

A
  B b /B
  C/
  D d D
/A

have this

A
  B b B
  D d D
/A

Postnext
(Deleted User) Subject: RE: remove empty xml tags
Author: (Deleted User)
Date: 13 Feb 2003 01:46 PM
Only testing if the original content is empty.
Like this:




-----Original Message-----
From: stylus-studio-xslt Listmanager [mailto:listmanager@edn.exln.com]
Sent: quinta-feira, 13 de Fevereiro de 2003 19:00
Subject: remove empty xml tags


From: "Nicholas Peeke"

I'm a little new to XSL and is there a simple way in the XML-to-XML mapper
to remove empty XML tags in an XML to XML transform?

instead of

A
B b /B
C/
D d D
/A

have this

A
B b B
D d D
/A



To reply: mailto:stylus-studio-xslt.6280@edn.exln.com
To start a new topic: mailto:stylus-studio-xslt@edn.exln.com
To login: http://edn.exln.com/~SSDN

Postnext
Nicholas PeekeSubject: RE: remove empty xml tags
Author: Nicholas Peeke
Date: 13 Feb 2003 02:54 PM
so for each element in an XML transform i need to wrap it in an xsl:if statement first checking if the value exists, there has to be a cleaner way.

Postnext
Minollo I.Subject: RE: remove empty xml tags
Author: Minollo I.
Date: 13 Feb 2003 03:28 PM
Unfortunately there isn't an easier way to do that in the current version
of XML to XML mapper. We will address that and other issues in future
versions of Mapper.

Hopefully you don't add the xsl:if instruction to each tag that you are
mapping...

Minollo

Postnext
Rob SutherlandSubject: RE: remove empty xml tags
Author: Rob Sutherland
Date: 13 Feb 2003 03:30 PM
Try this









This doesn't have recurssion or anything of that nature, but you could add
that if you want.
This should do what you are trying to do.

If you wanted to make this a named template and then pass parameters, that
should work to.

Rob Sutherland
rob@robsutherland.net



-----Original Message-----
From: stylus-studio-xslt Listmanager [mailto:listmanager@edn.exln.com]
Sent: Thursday, February 13, 2003 12:12 PM
To: Recipients of 'stylus-studio-xslt' suppressed
Subject: RE: remove empty xml tags


From: "Nicholas Peeke"

so for each element in an XML transform i need to wrap it in an xsl:if
statement first checking if the value exists, there has to be a cleaner way.



To reply: mailto:stylus-studio-xslt.6282@edn.exln.com
To start a new topic: mailto:stylus-studio-xslt@edn.exln.com
To login: http://edn.exln.com/~SSDN

Posttop
Rob SutherlandSubject: RE: remove empty xml tags
Author: Rob Sutherland
Date: 13 Feb 2003 03:32 PM
Well, I don't know if this will actually work in the XML to XML mapper of
Stylus Studio, but this is valid XSLT.

Rob

>>>

Try this









This doesn't have recurssion or anything of that nature, but you could add
that if you want.
This should do what you are trying to do.

If you wanted to make this a named template and then pass parameters, that
should work to.

Rob Sutherland
rob@robsutherland.net

<<<

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.