I need to transform an xml file into a different format (Dublin Core schema) using xslt, file contains different records each record needs to transformed based on a unique ID (in this case its element <guid>) that represents the record. Input file is:
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="UTF-8" ?>
- <ListRecords>
- <record>
- <header>
- <identifier>Project_DEM_100</identifier>
- <datestamp>2000-02-14T09:23:25Z</datestamp>
- </header>
- <metadata>
- <group xsi:noNamespaceSchemaLocation="http://url.for.schema/schema.xsd">
- <title>USER.765</title>
- <feed>
- <title>My feed</title>
- <url>no.url.available</url>
- <item>
- <!-- Here guid is the unique id for each of the records and also for transformation into another xml format -->
- <guid>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</guid>
- <events>
- <event>
- <dateTime>2000-03-26T13:27:49.00</dateTime>
- <action>
- <actionType>doSomeAtcion</actionType>
- <relatedData>
- <metadata>
- <lom xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM">
- <general >
- <identifier>
- <entry>340</entry>
- </identifier>
- <identifier>
- <identifier>
- <catalog>oai</catalog>
- <entry>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</entry>
- </identifier
- <title>
- <langstring>
- <value>Graduation mw. S. de Caralt</value>
- <language>en</language>
- </langstring>
- </title>
- <catalogentry>
- <catalog>nl.wur.wurtv</catalog>
- <entry>
- <langstring>
- <value>340</value>
- <language>x-none</language>
- </langstring>
- </entry>
- </catalogentry>
- <grouplanguage>en</grouplanguage>
- <description>
- <langstring>
- <value>Sponge Culture: Learning from Biology and Ecology</value>
- <language>en</language>
- </langstring>
- </description>
- </general>
- <metametadata >
- <identifier>
- <entry>340</entry>
- </identifier>
- <identifier>
- <catalog>oai</catalog>
- <entry>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</entry>
- </identifier>
- <contribute>
- <date>
- <dateTime>2001-12-01T00:00:00.00Z</dateTime>
- </date>
- </contribute>
- <contribute>
- <role>
- <source>PROJECT1.0</source>
- <value>provider</value>
- </role>
- <entity>
- BEGIN:VCARD User VERSION:3.0 END:VCARD
- </entity>
- <date>
- <dateTime>2001-10-10T15:56:17.58Z</dateTime>
- </date>
- </contribute>
- <metadatascheme>LORENET</metadatascheme>
- </metametadata>
- </lom>
- </metadata>
- </relatedData>
- </action>
- </event>
- </events>
- </item>
- </feed>
- </group>
- </metadata>
- </record>
- <record>
- <!-- similar other records that are distnguished with unique id's (guid element) -->
- </record>
- </ListRecords>
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="UTF-8" ?>
- <ListRecords>
- <record>
- <dc:header>Project_DEM_100</dc:header>
- <dc:date>2000-02-14T09:23:25Z</dc:date>
- <metadata>
- <group xsi:noNamespaceSchemaLocation="http://url.for.schema/schema.xsd">
- <dc:title>USER.765</dc:title>
- <dc:feedData>
- <dc:title>My feed</dc:title>
- <dc:url>no.url.available</dc:url>
- <dc:item>
- <!-- Here identifier is the unique id for each of the records and guid element is changed into identifier element -->
- <dc:identifier>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</dc:identifier>
- <dc:events>
- <dc:event>
- <dc:dateTime>2000-03-26T13:27:49.00</dc:dateTime>
- <dc:userAction>
- <dc:actionType>doSomeAtcion</dc:actionType>
- <dc:relatedData>
- <metadata>
- <lom xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM">
- <general >
- <dc:identifier>340</dc:identifier>
- <identifier>
- <dc:identifier>oa1,oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</identifier
- <dc:title>Graduation mw. S. de Caralt</dc:title>
- <dc:catalogentry>
- <dc:catalog>nl.wur.wurtv</dc:catalog>
- <dc:language>x-none</dc:language>
- </dc:catalogentry>
- <dc:language>en</dc:language>
- <dc:description>Sponge Culture: Learning from Biology and Ecology</dc:description>
- </general>
- <metametadata >
- <dc:identifier>340</identifier>
- <dc:identifier>oai, oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</dc:identifier>
- <dc:contribute>
- <dc:date>2001-10-10T15:56:17.58Z</dc:date>
- </dc:contribute>
- <dc:contribute>
- <dc:role>PROJECT1.0,provide</dc:role>
- <entity>
- BEGIN:VCARD User VERSION:3.0 END:VCARD
- </entity>
- <dc:date>2001-10-10T15:56:17.58Z</dc:date>
- </dc:contribute>
- <dc:metadatascheme>LORENET</dc:metadatascheme>
- </metametadata>
- </lom>
- </metadata>
- </dc:relatedData>
- </dc:userAction>
- </dc:event>
- </dc:events>
- </dc:item>
- </dc:feedData>
- </group>
- </metadata>
- </record>
- <record>
- <!-- similar other records that are distnguished with unique id's (guid element) and trasnformed into above format -->
- </record>
- </ListRecords>
Thnx. & regards..