473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

changeone xml schema to another usinf xslt?

I have the following XML file -

<root>
<book>
<section>art</section>
<title>abc</title>
<author>mark</author>
</book>
<book>
<section>science</section>
<title>def</title>
<author>jeff</author>
</book>
<book>
<section>art</section>
<title>pqr</title>
<author>tracy</author>
</book>
<book>
<section>science</section>
<title>xyz</title>
<author>albert</author>
</book>
</root>
I want to convert the above schema to look like the following schema
-
<root>
<section>
<name>art</name>
<book>
<title>abc</title>
<author>mark</author>
</book>
<book>
<title>pqr</title>
<author>tracy</author>
</book>
</section>
<section>
<name>science</name>
<book>
<title>def</title>
<author>jeff</author>
</book>
<book>
<title>xyz</title>
<author>albert</author>
</book>
</section>
</root>
Can this be done using XSLT? How can I change the schema?
Thanks in advance.
- Parth

Mar 2 '06 #1
2 1092
parth wrote:
Can this be done using XSLT? How can I change the schema?


This isn't a "schema change" problem, and searching for such a thing
will mislead you. Years ago we used to hear a lot about "XSLT as the
universal solution to schema mapping", but it never really worked.

What you have here is basically the same schema, but re-organised. Your
problem is more of a grouping problem and you should find the
following helpful
http://jenitennison.com/xslt/grouping/

Mar 3 '06 #2
Thanks a lot. This link was very helpful. :)

Mar 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
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. ...
1
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?...
4
by: Porthos | last post by:
Hi All, I've been working on mining data from a schema file (all attribute data so far) and have come to the point where I need to get information that is contained in tags. For instance,...
3
by: kelvSYC | last post by:
Is it possible to make an attribute required, optional, or forbidden depending on the value of another attribute? How about changing element content based on an attribute? -- I am only a...
1
by: thijs.kupers | last post by:
Hi Anyone knows where I can find the xml-schema of xslt? thanks...
1
by: mflll | last post by:
How does one say in one schema that one wants an element defined in another schema. For example, I want to include in the Employee definition, an Address element defined in the schema...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
1
by: sakhawn | last post by:
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.