Input XML:
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href="Sample.xsl" type="text/xsl"?>
<chapter version="5.1" xml:lang="en" xmlns="http://www.elsevier.com/xml/ehs-book/dtd" xmlns:sb="http://www.elsevier.com/xml/common/dtd" xmlns:ce="http://www.elsevier.com/xml/common/dtd" xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<ce
http://forums.tizag.com/images/smilies/tongue.gifii>
</ce
http://forums.tizag.com/images/smilies/tongue.gifii>
<ce:isbn>
</ce:isbn>
<ce:copyright type="full-transfer" year="2008">Elsevier Inc.</ce:copyright>
</info>
<ce:label/>
<ce:title/>
<ce:sections>
<ce
http://forums.tizag.com/images/smilies/tongue.gifara/>
</ce:sections>
<ce:bibliography id="biblio001">
<ce:section-title id="st0010">Vancouver style (Styles 3 (numbered) and 4 (name-date)):</ce:section-title>
<ce:bibliography-sec id="bibl001">
<ce:bib-reference id="bib001">
<ce:label>[1]</ce:label>
<sb:reference id="ref001">
<sb:contribution>
<sb:authors>
<sb:author>
<ce:surname>Paivio</ce:surname>
<ce:given-name>A</ce:given-name>
</sb:author>
<sb:author>
<ce:surname>Jansen</ce:surname>
<ce:given-name>B</ce:given-name>
</sb:author>
<sb:author>
<ce:surname>Becker</ce:surname>
<ce:given-name>LJ</ce:given-name>
</sb:author>
</sb:authors>
<sb:title>
<sb:maintitle>Comparisons through the mind's eye</sb:maintitle>
</sb:title>
</sb:contribution>
<sb:host>
<sb:issue>
<sb:series>
<sb:title>
<sb:maintitle>Cognition</sb:maintitle>
</sb:title>
<sb:volume-nr>37</sb:volume-nr>
</sb:series>
<sb:issue-nr>2</sb:issue-nr>
<sb:date>1975</sb:date>
</sb:issue>
<sb
http://forums.tizag.com/images/smilies/tongue.gifages>
<sb:first-page>635</sb:first-page>
<sb:last-page>647</sb:last-page>
</sb
http://forums.tizag.com/images/smilies/tongue.gifages>
</sb:host>
</sb:reference>
</ce:bib-reference>
<ce:bib-reference id="bib002">
<ce:label>[2]</ce:label>
<sb:reference id="ref002">
<sb:contribution>
<sb:authors>
<sb:author>
<ce:surname>Yuen</ce:surname>
<ce:given-name>AWC</ce:given-name>
</sb:author>
</sb:authors>
<sb:title>
<sb:maintitle>Lamotrigine: a review of antiepileptic efficacy</sb:maintitle>
</sb:title>
</sb:contribution>
<sb:host>
<sb:issue>
<sb:series>
<sb:title>
<sb:maintitle>Epilepsia</sb:maintitle>
</sb:title>
<sb:volume-nr>35</sb:volume-nr>
</sb:series>
<sb:issue-nr>Suppl. 5</sb:issue-nr>
<sb:date>1994</sb:date>
</sb:issue>
<sb
http://forums.tizag.com/images/smilies/tongue.gifages>
<sb:first-page>S33</sb:first-page>
<sb:last-page>S36</sb:last-page>
</sb
http://forums.tizag.com/images/smilies/tongue.gifages>
</sb:host>
</sb:reference>
</ce:bib-reference>
</ce:bibliography-sec>
</ce:bibliography>
</chapter>
my attempt XSL Document:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:sb="http://www.w3.org/1999/XSL/Transform" xmlns:ce="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput use-character-maps="Allentities" method="xml"/>
<xsl:character-map name="Allentities">
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="'" string="'"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="–" string="&ndash;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="ë" string="&euml;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="<" string="<"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character=">" string=">"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="#" string="&#x0023;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="%" string="&#x0025;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="&" string="&#x0026;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="'" string="&#x0027;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character=" " string="&#x00A0;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="©" string="&#x00A9;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="ß" string="&#x00DF;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="ä" string="&#x00E4;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="è" string="&#x00E8;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="é" string="&#x00E9;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="ö" string="&#x00F6;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="ü" string="&#x00FC;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="ý" string="&#x00FD;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="č" string="&#x010D;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="š" string="&#x0161;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="–" string="&#x2013;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="‘" string="&#x2018;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="’" string="&#x2019;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="“" string="&#x201C;"/>
<xsl
http://forums.tizag.com/images/smilies/redface.gifutput-character character="”" string="&#x201D;"/>
</xsl:character-map>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="ce:label[. = '[1]']">
<xsl:next-match/>
<xsl:text>,</xsl:text>
</xsl:template>
</xsl:stylesheet>
We need the Output XML Structure is below:
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href="Sample.xsl" type="text/xsl"?>
<chapter version="5.1" xml:lang="en" xmlns="http://www.elsevier.com/xml/ehs-book/dtd" xmlns:sb="http://www.elsevier.com/xml/common/dtd" xmlns:ce="http://www.elsevier.com/xml/common/dtd" xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<ce
http://forums.tizag.com/images/smilies/tongue.gifii>
</ce
http://forums.tizag.com/images/smilies/tongue.gifii>
<ce:isbn>
</ce:isbn>
<ce:copyright type="full-transfer" year="2008">Elsevier Inc.</ce:copyright>
</info>
<ce:label/>
<ce:title/>
<ce:sections>
<ce
http://forums.tizag.com/images/smilies/tongue.gifara/>
</ce:sections>
<ce:bibliography id="biblio001">
<ce:section-title id="st0010">Vancouver style (Styles 3 (numbered) and 4 (name-date)):</ce:section-title>
<ce:bibliography-sec id="bibl001">
<ce:bib-reference id="bib001">
<ce:label>[1]</ce:label>,
<sb:reference id="ref001">
<sb:contribution>
<sb:authors>
<sb:author>
<ce:surname>Paivio</ce:surname>
<ce:given-name>A</ce:given-name>
</sb:author>
<sb:author>
<ce:surname>Jansen</ce:surname>
<ce:given-name>B</ce:given-name>
</sb:author>
<sb:author>
<ce:surname>Becker</ce:surname>
<ce:given-name>LJ</ce:given-name>
</sb:author>
</sb:authors>
<sb:title>
<sb:maintitle>Comparisons through the mind's eye</sb:maintitle>
</sb:title>
</sb:contribution>
<sb:host>
<sb:issue>
<sb:series>
<sb:title>
<sb:maintitle>Cognition</sb:maintitle>
</sb:title>
<sb:volume-nr>37</sb:volume-nr>
</sb:series>
<sb:date>1975</sb:date>
<sb:issue-nr>2</sb:issue-nr>
</sb:issue>
<sb
http://forums.tizag.com/images/smilies/tongue.gifages>
<sb:first-page>635</sb:first-page>
<sb:last-page>647</sb:last-page>
</sb
http://forums.tizag.com/images/smilies/tongue.gifages>
</sb:host>
</sb:reference>
</ce:bib-reference>
<ce:bib-reference id="bib002">
<ce:label>[2]</ce:label>,
<sb:reference id="ref002">
<sb:contribution>
<sb:authors>
<sb:author>
<ce:surname>Yuen</ce:surname>
<ce:given-name>AWC</ce:given-name>
</sb:author>
</sb:authors>
<sb:title>
<sb:maintitle>Lamotrigine: a review of antiepileptic efficacy</sb:maintitle>
</sb:title>
</sb:contribution>
<sb:host>
<sb:issue>
<sb:series>
<sb:title>
<sb:maintitle>Epilepsia</sb:maintitle>
</sb:title>
<sb:volume-nr>35</sb:volume-nr>
</sb:series>
<sb:date>1994</sb:date>
<sb:issue-nr>Suppl. 5</sb:issue-nr>
</sb:issue>
<sb
http://forums.tizag.com/images/smilies/tongue.gifages>
<sb:first-page>S33</sb:first-page>
<sb:last-page>S36</sb:last-page>
</sb
http://forums.tizag.com/images/smilies/tongue.gifages>
</sb:host>
</sb:reference>
</ce:bib-reference>
</ce:bibliography-sec>
</ce:bibliography>
</chapter>
In the out xml need to swap the some elements i.e <sb:date>and <sb:issue-nr>, I will highlighted bold in the output format.
Insert some of the elements after commos, dot etc.... I show you the one sample is <ce:label> after the commos inserted in the output format.
Important:
In my xsl is able to copy all the element with attributes only, Not able to insert the commos in some of the elements, and swap also.
Please guide and help me if there is any different logic methods to achieve this task.
Thanks
Nagaraj