Hi,
I want to change :
<?xml version="1.0" ?>
<nplbiblio >
<document status="U" creadate="19990410">
<xp>000000001</xp>
<doctype>JOURN-ART</doctype>
<prdate>19880901</prdate>
<ord>19880901</ord>
<titles>
<title>MORPHOLOGY OF NI/GAAS SURFACES</title>
</titles>
<author>SINHA M P, MAHAPATRA S</author>
<supplier>MIGRATION</supplier>
<attribs>
<attrib name="nr_hostdoc">5</attrib>
<attrib name="pg_from_hostdoc">19-21</attrib>
<attrib name="vol_hostdoc">19</attrib>
</attribs>
<publication>
<irn>
<issn>0026-2692</issn>
</irn>
</document>
<document status="U" creadate="19990410">
<xp>000000002</xp>
<doctype>JOURN-ART</doctype>
<prdate>19880901</prdate>
<ord>19880901</ord>
<titles>
<title>GRAFT COPOLYMERIZATION OF METHYL METHACRYLATE ON POLY (VINYL CHLORIDE).</title>
</titles>
<author>PREMAMOY GHOSH, ARABINDA SHEKHAR BHATTACHARYYA, SOMNATH MAITRA.</author>
<supplier>MIGRATION</supplier>
<attribs>
<attrib name="pg_from_hostdoc">135 - 148</attrib>
<attrib name="vol_hostdoc">162</attrib>
</attribs>
<publication>
<irn>
<issn>0003-3146</issn>
</irn>
</document>
</nplbiblio>
into :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE nplbiblio SYSTEM "npl-entities.dtd">
<nplbiblio xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:npl="http://www.epo.org/npl" xsi:noNamespaceSchemaLocation="npldoc v2.0.xsd" rundate="20080123">
<document status="n" creadate="20080123">
<xp>000000001</xp>
<doctype>JOURN-ART</doctype>
<prdate>19880901</prdate>
<xp>000000001</xp>
<author>SINHA M P, MAHAPATRA S</author>
<supplier>MIGRATION</supplier>
<title>MORPHOLOGY OF NI/GAAS SURFACES</title>
<isbn/>
<issn>0026-2692</issn>
<first_page>19-21</first_page>
<issue>5</issue>
<volume>19</volume>
</document>
<document status="n" creadate="20080123">
<xp>000000002</xp>
<doctype>JOURN-ART</doctype>
<prdate>19880901</prdate>
<xp>000000002</xp>
<author>PREMAMOY GHOSH, ARABINDA SHEKHAR BHATTACHARYYA, SOMNATH MAITRA.</author>
<supplier>MIGRATION</supplier>
<title>GRAFT COPOLYMERIZATION OF METHYL METHACRYLATE ON POLY (VINYL CHLORIDE).</title>
<isbn/>
<issn>0003-3146</issn>
<first_page>135-148</first_page>
<volume>162</volume>
</document>
</nplbiblio>
I have written this XLS which works at 95%:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:npl="http://www.epo.org/npl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" doctype-system="npl-entities.dtd"/>
<xsl:key name = "kkk" match = "attribs/attrib" use = "@name" />
<xsl:template match="/">
<nplbiblio>
<xsl:attribute name="xsi:noNamespaceSchemaLocation">npldoc v2.0.xsd</xsl:attribute>
<xsl:attribute name="rundate">20080123</xsl:attribute>
<xsl:for-each select="nplbiblio/document">
<document status="n">
<xsl:attribute name="creadate">20080123</xsl:attribute>
<xsl:copy-of select="xp"/>
<xsl:copy-of select="doctype"/>
<xsl:copy-of select="prdate"/>
<xsl:copy-of select="xp"/>
<xsl:copy-of select="author"/>
<xsl:copy-of select="supplier"/>
<title>
<xsl:value-of select="titles/title"/>
</title>
<isbn>
<xsl:value-of select="publication/irn/isbn"/>
</isbn>
<issn>
<xsl:value-of select="publication/irn/issn"/>
</issn>
<first_page>
<xsl:value-of select = "key('kkk','pg_from_hostdoc')" />
</first_page>
<issue>
<xsl:value-of select = "key('kkk','nr_hostdoc')" />
</issue>
<volume>
<xsl:value-of select = "key('kkk','vol_hostdoc')" />
</volume>
</document>
</xsl:for-each>
</nplbiblio>
</xsl:template>
</xsl:stylesheet>
The only problem with the output is that the values of 'pg_from_hosdoc' , 'nr_hostdoc' and 'vol_hostdoc' are taken from the first record and repeats on the next record :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE nplbiblio SYSTEM "npl-entities.dtd">
<nplbiblio xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:npl="http://www.epo.org/npl" xsi:noNamespaceSchemaLocation="npldoc v2.0.xsd" rundate="20080123">
<document status="n" creadate="20080123">
<xp>000000001</xp>
<doctype>JOURN-ART</doctype>
<prdate>19880901</prdate>
<xp>000000001</xp>
<author>SINHA M P, MAHAPATRA S</author>
<supplier>MIGRATION</supplier>
<title>MORPHOLOGY OF NI/GAAS SURFACES</title>
<isbn/>
<issn>0026-2692</issn>
<first_page>19-21</first_page>
<issue>5</issue>
<volume>19</volume>
</document>
<document status="n" creadate="20080123">
<xp>000000002</xp>
<doctype>JOURN-ART</doctype>
<prdate>19880901</prdate>
<xp>000000002</xp>
<author>PREMAMOY GHOSH, ARABINDA SHEKHAR BHATTACHARYYA, SOMNATH MAITRA.</author>
<supplier>MIGRATION</supplier>
<title>GRAFT COPOLYMERIZATION OF METHYL METHACRYLATE ON POLY (VINYL CHLORIDE).</title>
<isbn/>
<issn>0003-3146</issn>
<first_page>19-21</first_page>
<issue>5</issue>
<volume>19</volume>
</document>
</nplbiblio>