O
ofuuzo1
Hei,
I have the following xml file and I have tried to write xslt to
extract only the values of the first "record" node. It does not
work. I need some help. I used ---- to represent indent.
Xml:
<?xml version="1.0" encoding="UTF-8"?>
<OAI-PMH xmlns="http://www.openarchives.....OAI/2.0/OAI-PMH.xsd">
---<responseDate>2008-02-19T12:54:06Z</responseDate>
---<request xmlns="" verb="ListRecords" ......o.no</request>
---<ListRecords xmlns="">
-----<record> <!----the first record node I want to
extract -->
-------<header>
----------<identifier>oai:frida.uio.no:110517</identifier>
----------<datestamp>2004-12-16</datestamp>
----------<setSpec>UITT</setSpec>
-------</header>
.....
-----</record> <!-- end of the first record node I want to
extract --->
-----<record>
..........
-----</record>
...........
---</ListRecords>
</OAI-PMH>
xslt:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:template match="/ListRecords" >
<xsl:apply-templates select="child::node()[1]"/>
</xsl:template>
<xsl:template match="record">
<xsl:value-of select="*" />
</xsl:template>
</xsl:stylesheet>
Thanks in advance.
Ofuuzo
I have the following xml file and I have tried to write xslt to
extract only the values of the first "record" node. It does not
work. I need some help. I used ---- to represent indent.
Xml:
<?xml version="1.0" encoding="UTF-8"?>
<OAI-PMH xmlns="http://www.openarchives.....OAI/2.0/OAI-PMH.xsd">
---<responseDate>2008-02-19T12:54:06Z</responseDate>
---<request xmlns="" verb="ListRecords" ......o.no</request>
---<ListRecords xmlns="">
-----<record> <!----the first record node I want to
extract -->
-------<header>
----------<identifier>oai:frida.uio.no:110517</identifier>
----------<datestamp>2004-12-16</datestamp>
----------<setSpec>UITT</setSpec>
-------</header>
.....
-----</record> <!-- end of the first record node I want to
extract --->
-----<record>
..........
-----</record>
...........
---</ListRecords>
</OAI-PMH>
xslt:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:template match="/ListRecords" >
<xsl:apply-templates select="child::node()[1]"/>
</xsl:template>
<xsl:template match="record">
<xsl:value-of select="*" />
</xsl:template>
</xsl:stylesheet>
Thanks in advance.
Ofuuzo