Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 21st, 2006, 09:28 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default xsl:output and removing space in XML

Hi All,

Following is my Output XML

<authorgrp>
         <author>
            <fname>clive</fname>
            <x> </x>
            <surname>webb</surname>
         </author>
      </authorgrp>

Used XSL
<xsl:output method="xml" encoding="iso-8859-1" indent="yes" omit-xml-declaration="yes" />


Required XML
<authorgrp>
<author><fname>clive</fname><x> </x><surname>webb</surname></author>
</authorgrp>

As you see in the output xml elements and contents were indent due to xsl:output with indent="yes" if it was "no" the output come in a single line. But my request is that I would like to get the out as shown in required XML were I would like to pass the syntax in XSLT, is there any syntax that we can pass? .

Any help would be appreciated.

Thanks & Regards,
ROCXY.


__________________
Thanks,
Rocxy.
 
Old March 21st, 2006, 09:38 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You will have to switch off automatic indenting and generate the required newline characters yourself. You can output a newline using

<xsl:text>#xa;</xsl:text>



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL Transformation for empty space ashokhr XSLT 3 October 10th, 2006 04:09 AM
removing unwanted space below table ngvietanh HTML Code Clinic 1 August 24th, 2006 10:28 AM
removing name space (qname i think) TylerDerdin XSLT 3 August 23rd, 2006 01:14 PM
Usage of "xsl:strip-space" ROCXY XSLT 1 January 4th, 2006 05:31 AM
Removing Namespaces from XSL Transform output francislang XSLT 2 September 7th, 2004 07:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.