473,665 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML schema transformation with XSLT

9 New Member
hi all,
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
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <ListRecords>
  3. <record>
  4. <header>
  5. <identifier>Project_DEM_100</identifier>
  6. <datestamp>2000-02-14T09:23:25Z</datestamp>
  7. </header>
  8. <metadata>
  9. <group xsi:noNamespaceSchemaLocation="http://url.for.schema/schema.xsd">
  10. <title>USER.765</title>
  11. <feed>
  12. <title>My feed</title>
  13. <url>no.url.available</url>
  14. <item>
  15. <!-- Here guid is the unique id for each of the records and also for transformation into another xml format -->
  16. <guid>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</guid>
  17. <events>
  18. <event>
  19. <dateTime>2000-03-26T13:27:49.00</dateTime>
  20. <action>
  21. <actionType>doSomeAtcion</actionType>
  22. <relatedData>
  23. <metadata>
  24. <lom xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM">
  25. <general >
  26. <identifier>
  27. <entry>340</entry>
  28. </identifier>
  29. <identifier>
  30. <identifier>
  31. <catalog>oai</catalog>
  32. <entry>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</entry>
  33. </identifier
  34. <title>
  35. <langstring>
  36. <value>Graduation mw. S. de Caralt</value>
  37. <language>en</language>
  38. </langstring>
  39. </title>
  40. <catalogentry>
  41. <catalog>nl.wur.wurtv</catalog>
  42. <entry>
  43. <langstring>
  44. <value>340</value>
  45. <language>x-none</language>
  46. </langstring>
  47. </entry>
  48. </catalogentry>
  49. <grouplanguage>en</grouplanguage>
  50. <description>
  51. <langstring>
  52. <value>Sponge Culture: Learning from Biology and Ecology</value>
  53. <language>en</language>
  54. </langstring>
  55. </description>
  56. </general>
  57. <metametadata >
  58. <identifier>
  59. <entry>340</entry>
  60. </identifier>
  61. <identifier>
  62. <catalog>oai</catalog>
  63. <entry>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</entry>
  64. </identifier>
  65. <contribute>
  66. <date>
  67. <dateTime>2001-12-01T00:00:00.00Z</dateTime>
  68. </date>
  69. </contribute>
  70. <contribute>
  71. <role>
  72. <source>PROJECT1.0</source>
  73. <value>provider</value>
  74. </role>
  75. <entity>
  76. BEGIN:VCARD User VERSION:3.0 END:VCARD
  77. </entity>
  78. <date>
  79. <dateTime>2001-10-10T15:56:17.58Z</dateTime>
  80. </date>
  81. </contribute>
  82. <metadatascheme>LORENET</metadatascheme>
  83. </metametadata>
  84. </lom>
  85. </metadata>
  86. </relatedData>
  87. </action>
  88. </event>
  89. </events>
  90. </item>
  91. </feed>
  92. </group>
  93. </metadata>
  94. </record>
  95. <record>
  96. <!-- similar other records that are distnguished with unique id's (guid element) -->
  97. </record>
  98. </ListRecords>
The oupt file should be:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <ListRecords>
  3. <record>
  4. <dc:header>Project_DEM_100</dc:header>
  5. <dc:date>2000-02-14T09:23:25Z</dc:date>
  6. <metadata>
  7. <group xsi:noNamespaceSchemaLocation="http://url.for.schema/schema.xsd">
  8. <dc:title>USER.765</dc:title>
  9. <dc:feedData>
  10. <dc:title>My feed</dc:title>
  11. <dc:url>no.url.available</dc:url>
  12. <dc:item>
  13. <!-- Here identifier is the unique id for each of the records and guid element is changed into identifier element -->
  14. <dc:identifier>oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</dc:identifier>
  15. <dc:events>
  16. <dc:event>
  17. <dc:dateTime>2000-03-26T13:27:49.00</dc:dateTime>
  18. <dc:userAction>
  19. <dc:actionType>doSomeAtcion</dc:actionType>
  20. <dc:relatedData>
  21. <metadata>
  22. <lom xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM">
  23. <general >
  24. <dc:identifier>340</dc:identifier>
  25. <identifier>
  26. <dc:identifier>oa1,oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</identifier
  27. <dc:title>Graduation mw. S. de Caralt</dc:title>
  28. <dc:catalogentry>
  29. <dc:catalog>nl.wur.wurtv</dc:catalog>
  30. <dc:language>x-none</dc:language>
  31. </dc:catalogentry>
  32. <dc:language>en</dc:language>
  33. <dc:description>Sponge Culture: Learning from Biology and Ecology</dc:description>
  34. </general>
  35. <metametadata >
  36. <dc:identifier>340</identifier>
  37. <dc:identifier>oai, oai:triple-l:2c7ba037-52a6-4323-97dd-b6ea1cdbfd18:340</dc:identifier>
  38. <dc:contribute>
  39. <dc:date>2001-10-10T15:56:17.58Z</dc:date>
  40. </dc:contribute>
  41. <dc:contribute>
  42. <dc:role>PROJECT1.0,provide</dc:role>
  43. <entity>
  44. BEGIN:VCARD User VERSION:3.0 END:VCARD
  45. </entity>
  46. <dc:date>2001-10-10T15:56:17.58Z</dc:date>
  47. </dc:contribute>
  48. <dc:metadatascheme>LORENET</dc:metadatascheme>
  49. </metametadata>
  50. </lom>
  51. </metadata>
  52. </dc:relatedData>
  53. </dc:userAction>
  54. </dc:event>
  55. </dc:events>
  56. </dc:item>
  57. </dc:feedData>
  58. </group>
  59. </metadata>
  60. </record>
  61. <record>
  62. <!-- similar other records that are distnguished with unique id's (guid element) and trasnformed into above format -->
  63. </record>
  64. </ListRecords>
I don't know anything about xslt so need help about how this tranformation can be done..
Thnx. & regards..
Mar 3 '09 #1
1 4361
Dormilich
8,658 Recognized Expert Moderator Expert
I think the best for you is to start with a tutorial (XSLT @ w3schools) to get used to the language.

if you run into problem, just ask us.

regards
Mar 3 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2700
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron extension responsible for the xslt functions. The problem i have is that the obtained transformation is not the waited one. I try to proccess the same XML file with XSL file with a program called XMLspy and i obtained the desire and waited...
7
3242
by: CK | last post by:
Hello, I have the 60 MB XML string and I am coding a program in Visual Basic to run a XSL transformation on it. Currently, I'm using the Microsoft standard MSXML 2.0 to create a DOM document, load the XML, and then run the XSL transformation on it using the MSXML2.IXSLProcessor interface. The problem is that it kills my system because of an incredible amount of memory that it requires to do this (around 850 MB). Are there any other...
6
2485
by: Pieter | last post by:
I've read a lot of posts on "why relax ng is so very good" and on "why w3c xml schema should be the only schema language". I'm, however, still not clear on why I should prefer one over the other. I've made a small list of some good and bad points of both. These points don't really go into the grammar aspects of these languages, but are more about secondary aspects. The grammar aspects are different, but both are suitable for validating...
1
2090
by: Hari Om | last post by:
Subject: XML Schema to XML Schema Conversion I have an XML Schema A which needs to mapped to another XML Schema B. Is there any handy tool which I could use to convert from Schema A to Schema B? Any related informaiton on this is appreciated. Thanks!
12
3219
by: gipsy boy | last post by:
Hello, I have sort of a big problem. I would really appreciate any help you could give me. I made a web service in C++ that throws XML to the client (browser). But, the XSLT transormation (xml->html) doen't happen! I have XSLT files for this, they work, I mean when I put the output of the app as an XML file on some server, and make it use the XSLT files to transform into HTML, it works, I get a HTML page.
1
1311
by: Ash Hart | last post by:
Hi Friends, We have a peculiar situation here, where in we have to translate a set of xml documents using xslt and we only have schemas available. How do we use XSLT here? Please advice. Ash
1
1419
by: M Ali | last post by:
Hi, I am in a situation where I don't have access to an xml, say "original.xml". But I do have the schema for it and an XSLT transformation on it that would create a new xml from "original.xml" called "transform.xml". What i need is the schema for the "transform.xml". I could generate the schema from the xml if I had "transform.xml". But I don't have access to "original.xml" so I cannot apply the transform to get
6
4429
by: LesleyW | last post by:
Hi Apologies if this is a really dumb question, but being new to XML and Schemas, I wonder if giving the namespace for eg xsd or xsi as a website address means that the user has to be online when they run the app? If so, what should I do if I can't guarantee that they will be? Can I bring all these files into the app? Is that desirable? I'm about to write an app that takes an XML file as input, using Visual Studio 2005 Express and SQL...
0
1031
by: Kensei | last post by:
I have a small ASP.NET page that has a web form (.aspx) page, an xslt transformation page, and an xml page. Everything works great until I add a schema (.xsd) page to validate the xml data. After adding the schema, I can't get the xml data to appear on the screen... it's blank. When I take the schema reference out of the xml document, everything works great again. I'm using to MS Visual Studio.NET to develop the web site. When I add the...
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.