xsl-list
[Top] [All Lists]

RE: [xsl] Blank lines in transformed XML

2007-11-06 07:08:17
The chances are you are copying whitespace text nodes from the input to the
output.

If the whitespace text nodes in the input have no significance, get rid of
them using <xsl:strip-space>.

This may remove some whitespace from the output that you wanted to keep. You
can use <xsl:output indent="yes"/> to add whitespace to the output.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Thomas Jackie R Ctr HQ 754 ELSG/LRM 
[mailto:Jackie(_dot_)Thomas(_dot_)Ctr(_at_)Gunter(_dot_)Af(_dot_)Mil] 
Sent: 06 November 2007 13:46
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Blank lines in transformed XML

We are transforming xml being output by a program into xml to 
match our xml schema.  We basically copy the original xml in 
the following way: 
<xsl:template match="/"><xsl:apply-templates 
/></xsl:template> and/or <xsl:template 
match="*"><xsl:copy><xsl:apply-templates
/></xsl:copy></xsl:template> and then we maniputlate the xml 
where needed. In doing so we rename tags, manipulate tag 
contents and omit tags altogether.  The way we are omitting 
tags is with a blank template match.  For example 
<xsl:template match="title"/> is our way of omitting any 
<title> tags from our transformed xml.  The problem is, the 
transformed xml now has blank lines anywhere a <title> tag 
would have appeared.  

How do we remove the blank lines from the transformed xml.  
We are using xml/xslt 1.0 and the xerces parser.  Thanks for any help.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>