473,385 Members | 1,796 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,385 software developers and data experts.

Un-flattening XML-data

Hi,

I am exporting data from a MS Access 2003-database and has to transform it
into a structured document. The input is as follows:

<departments>

<department>
<name>Community Services</name>
<person-in-charge-first-name>Gabriel</person-in-charge-first-name>
<person-in-charge-surname>Brown</person-in-charge-surname>
<portfolio-councillor-first-name>John</portfolio-councillor-first-name>
<portfolio-councillor-surname>Doe</portfolio-councillor-surname>
<primary-function>department primary function</primary-function>
<division-name>div1</division-name>
<division-person-in-charge-first-name>Peter</division-person-in-charge-first-name>
<division-person-in-charge-surname>Smith</division-person-in-charge-surname>
<division-function>Primary func here for div 1</division-function>
</department>
<department>
<name>Community Services</name>
<person-in-charge-first-name>Gabriel</person-in-charge-first-name>
<person-in-charge-surname>Brown</person-in-charge-surname>
<portfolio-councillor-first-name>John</portfolio-councillor-first-name>
<portfolio-councillor-surname>Doe</portfolio-councillor-surname>
<primary-function>department primary function</primary-function>
<division-name>div2</division-name>
<division-person-in-charge-first-name>Hillary</division-person-in-charge-first-name>
<division-person-in-charge-surname>Black</division-person-in-charge-surname>
<division-function>Primary func here for div 2</division-function>
</department>
</departments>

and the output has to be:

<departments>
<department name=Community Services>
<person-in-charge first-name=Gabriel surname=Brown/>
<portfolio-councillor first-name=John surname=Doe/>
<primary-functiondepartment primary function </primary-function>

<division name=div1>
<person-in-charge first-name=Peter surname=Smith/>
Primary func here for div 1
</division>

<division name=div2>
<person-in-charge first-name=Hillary surname=Black/>
Primary func here for div 2
</division>
</department>
</departments>

Any advice will be appreciated.

Regards,
Adri

Apr 2 '07 #1
1 2107
This can be done really easily using a XSLT transformation.
Check out http://www.w3schools.com/xsl/default.asp
for a really simple but good introduction.

Apr 3 '07 #2

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

Similar topics

1
by: Agathe | last post by:
Bonjour, Je souhaite insérer dans une table MySQL des données provenant d'un fichier texte grâce à un script PHP. Mon fichier porte l'extension "txt" et les données sont séparées par des ";'. ...
6
by: Raymond H. | last post by:
Bonjour, Je n'arrive pas à savoir comment lire via vb4 l'adresse d'un favoris dans le dossier des favoris où Internet Explorer place ses favoris. Par exemple, comment fait-on pour afficher l'url...
1
by: richard | last post by:
bonjour je me connecte à une base de données interbase/firebird en utilisant, KinterbasDB http://kinterbasdb.sourceforge.net/ pour ceux que ca interesse mais je pense que le probleme est le...
3
by: pascal Joseph | last post by:
J'ai un formulaire avec un seul champ text appelé "unite" et un bouton. En javascript j'aimerai utiliser un script qui interdise les valeurs de type "char" et soit supérieur à 0 J'ai trouvé...
5
by: Chris | last post by:
Bonjour, Plusieurs fichiers PHP d'un programme open source de compteur de visites viennent de se faire hacker sur mon serveur (hébergement mutualisé chez un fournisseur d'accès). Le hacker a...
3
by: Jorge Gallardo | last post by:
Hola de nuevo a todos... Agradecido a todos los que me habeis solucionado problemas anteriores... Pero como no es novedad, me surge otro. Recientemente buscando, adquiri un codigo para juntar...
1
by: Alex | last post by:
Ciao a tutti, sto sviluppando un applicazione windows, in breve all'interno dello stesso namespace ho un form con una datagrid e un thread che effettua dei controlli e "dovrebbe" caricare i dati...
15
by: Ciudad Tecnópolis | last post by:
Hola, primero que todo mil disculpas por postear una pregunta no relacionada al tema pero se que será muy útil para todos! Actualmente estoy presentando un desarrollo en .NET para una compañía y...
3
by: nano9 | last post by:
Hola gente quisiera que alguien me pudiera ayudar con un problemilla que tengo, resulta que estoy programando en ASP con C# y estoy usando un cadbgrid que se comporta parecido a un datagrid o...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.