[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Insert space after the closing element

Subject: Insert space after the closing element
From: "Selvaganesh" <selvaganesh_t@xxxxxxxxxxxxxx>
Date: Fri, 22 Jan 2010 12:43:12 +0530
 Insert space after the closing element
Dear Team,

In my xslt developed as to be insert the space before the opening tag &
after the closing tag. But after space do not insert few condition. (e.g. if
found the dot, comma, colon, semi-colon & mdash after closing tags do not
insert the space.)

This is my current XSLT:

<hov:stylesheet xmlns:hov="http://www.w3.org/1999/XSL/Transform"
 xpath-default-namespace="http://xml.smg-uk.com/schema/cases/report"
version="2.0">

<hov:import href="Entity/entitynamesmap.xsl"/>
<hov:output method="xml" indent="yes"
use-character-maps="w3c-entity-names"/>

<hov:template match="text()">
<hov:value-of select="normalize-space()"/>
</hov:template>

<hov:template match="report">
<hov:element name="report"><hov:apply-templates/></hov:element>
</hov:template>

<hov:template match="para">
<hov:element name="para-text">
<hov:attribute name="indent"><hov:text>1</hov:text></hov:attribute>
<hov:apply-templates/></hov:element>
</hov:template>

<hov:template match="legis-cite"><hov:text> </hov:text><hov:element
name="citation"><hov:apply-templates/></hov:element><hov:text>
</hov:text></hov:template>
</hov:stylesheet>

This is my current Output: (do not insert the space after the "Rights arts
8</citation> and 11</citation>" or remove space before the "dot, comma,
colon, semi-colon & mdash" after the transformed file.

               <para-text indent="1"> 
                  <citation>European Convention on Human Rights arts
8</citation> , <citation>10</citation> and <citation>11</citation> .
               </para-text>

Actual required:

               <para-text indent="1"> 
                  <citation>European Convention on Human Rights arts
8</citation>, <citation>10</citation> and <citation>11</citation>.
               </para-text>

This is input: 

<para id="89471df0-f798-430f-bfd1-b0dc6e53bfee"><legis-cite>
                            <ancestor-part id="bfd1"/>
                            <ancestor-part id="bfd1a"/>European
                            Convention on Human Rights arts 8</legis-cite>,
<legis-cite>
                            <ancestor-part id="bfd2"/>
                            <ancestor-part id="bfd2a"/>10</legis-cite> and
<legis-cite>
                            <ancestor-part id="bfd3"/>
                            <ancestor-part
id="bfd3a"/>11</legis-cite>.</para>

Kindly guide me how can I modify in my XSLT.

Thanks,
Selva


Confidentiality Notice:  This transmittal is a confidential communication.  If you are not the intended recipient, you are hereby notified that you have received this transmittal in error and that any review, dissemination, distribution or copying of this transmittal is strictly prohibited.  If you have received this communication in error, please notify this office immediately by reply and immediately delete this message and all of its attachments, if any.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.