Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > HTML, XML, Javascript, AJAX
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 05-11-2006, 12:20 AM   #1 (permalink)
bella_11041988
Registered User
 
Join Date: May 2006
Posts: 6
bella_11041988 is on a distinguished road
How to re-organized XML file and call XML file from my software

Hello, everybody. Sorry to disturb you all.
Currently, I have a speech recording and playback software developed by Microsoft Visual C++ 6.0. The software is used to train children with speech problem and scores will be calculated and showed at the end of each practice session. The software is able to record and playback real-time.

Children use this software at home and save their practice records in a single floppy disk. Then, children will bring the floppy disk with practice records inside when they return to our centre.

I have two problems with the xml programming part. My software automatically created history file (in XML format) to display the scores of the children’s practices. The history file (in XML format) is saved by the children in floppy disk when they return to our centre.
But, the data or information in the XML is in a mess where all data are put together. Do you mind to tell me what should I do to create more organized XML format? The therapist needs to scroll in order to read the scores. I have the program codes of XML in four of my cpp files.

The second question is how to call or open XML file (the history file) from my software?
My codes are as below. After I execute the program, it is error free and the File Open dialog box is popped up but no XML file came out after I select the desired XML file. My codes are as below:

Quote:
void CSpeechDlg::OnScore()
{
// TODO: Add your command handler code here
CFileDialog openfile(TRUE,NULL,NULL,OFN_OVERWRITEPROMPT,"XML File (*.xml)|*.xml|");
if (openfile.DoModal()==IDOK)
{
CString cs=openfile.GetFileName();
char* filename=new char[cs.GetLength()+1];
strcpy(filename,cs);
}

}
I promise I wont disturb you a lot, I promise I will do my best. Can you please help me?
I am totally new to this as the software is written by one of my previous friend who worked together with me in a voluntary speech rehabilitation centre. We need this software to train children in the centre. I work part time there.

Hope you can give me some guidances on how to do it. I promise I can learn as independent as possible but I really need your guidance at this very beginning, please.
Please, I really appreciate all your help.
__________________
bella_11041988 is offline   Reply With Quote
Old 05-11-2006, 01:00 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
hello, welcome to the site. i'm sure you're not disturbing anyone at all

have you looked into xslt yet? it's basically a way to make a style sheet for XML data.

you would need to include the xslt files along with the xml files on the disk, but then the therapist would be able to view a neatly formatted document which is populated by your xml file, all client side.

http://www.w3schools.com/xsl/default.asp
__________________
testing 1 2 3
sde is offline   Reply With Quote
Old 05-11-2006, 05:28 PM   #3 (permalink)
bella_11041988
Registered User
 
Join Date: May 2006
Posts: 6
bella_11041988 is on a distinguished road
Quote:
Originally Posted by sde
hello, welcome to the site. i'm sure you're not disturbing anyone at all

have you looked into xslt yet? it's basically a way to make a style sheet for XML data.

you would need to include the xslt files along with the xml files on the disk, but then the therapist would be able to view a neatly formatted document which is populated by your xml file, all client side.

http://www.w3schools.com/xsl/default.asp
Hi, Sde, thanks so much for your post, appreciate.

Hi, Diades, thank you very much for your reply, appreciate.
Sorry, I dont understand what you mean, I am sorry. YOu mean I should include the xsl codes into my current project platform? Could you please elaborate more? I am sorry, please forgive my stupidness.

My questions are:

1. I failed to use the above codes to open a XML file, I dont know what's wrong with the codes.

2. I attached the XML file created by my program. As you can see, it is created in an unorganized format. I hope it can be created with spacing between sentences so that it can be more easier to read. And, I hope therapist does not need to scroll to the far right end in order to read the children's scoring.

I really need your help at this very beginning, please help, please.
__________________
bella_11041988 is offline   Reply With Quote
Old 05-11-2006, 07:32 PM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Who's Diades?
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 05-12-2006, 12:43 AM   #5 (permalink)
bella_11041988
Registered User
 
Join Date: May 2006
Posts: 6
bella_11041988 is on a distinguished road
Quote:
Originally Posted by teknomage1
Who's Diades?
Sorry, my mistake, please forgive me.

Can you please help me? I promise I will try my best, just need guidance at this very beginning.
__________________
bella_11041988 is offline   Reply With Quote
Old 05-12-2006, 09:08 AM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
Here's another XSLT tutorial. http://www.zvon.org/xxl/XSLTutorial/...ok1/index.html

My advice is: Look into XSLT. If this project is important to you, then it will probably be worth the time and effort you spend researching it to determine if it is the right solution.
__________________
testing 1 2 3
sde is offline   Reply With Quote
Old 05-12-2006, 04:57 PM   #7 (permalink)
bella_11041988
Registered User
 
Join Date: May 2006
Posts: 6
bella_11041988 is on a distinguished road
Quote:
Originally Posted by sde
Here's another XSLT tutorial. http://www.zvon.org/xxl/XSLTutorial/...ok1/index.html

My advice is: Look into XSLT. If this project is important to you, then it will probably be worth the time and effort you spend researching it to determine if it is the right solution.

Hi, SDE, thank you very much for your reply.
I will look into details on theXSLT tutorial and tell you how I am going. Thanks.
Keep my fingers crossed...
__________________
bella_11041988 is offline   Reply With Quote
Old 05-13-2006, 06:07 PM   #8 (permalink)
bella_11041988
Registered User
 
Join Date: May 2006
Posts: 6
bella_11041988 is on a distinguished road
Hi.

Just asking, forgive me if I am wrong. Is it possible to copy the data in the XML file to a MFC dialog box? The data in the XML file is updated from time to time. I am just asking, I dont know whether it can be done or not. But, I just hope my problem can be solved using the simplest method as I am so stupid and I do not have enough knowledge due to my short experiences with programming (just about 2++ months) plus I am slow learner. Please forgive me. I didnt mean to confuse with so many methods but I just hope to learn the simplest so that the children can use the computer as soon as possible.

There are 3 things in my mind now: XSLT, Modify using XML Parser, open XML file in MFC dialog. Do you mind to give your opinions on which one is easier to display the children's scoring to the therapist?
__________________
bella_11041988 is offline   Reply With Quote
Old 05-14-2006, 10:53 PM   #9 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
i don't know anything about mfc, so i'm sorry i can't help ya with that.
__________________
testing 1 2 3
sde is offline   Reply With Quote
Old 05-16-2006, 05:06 PM   #10 (permalink)
bella_11041988
Registered User
 
Join Date: May 2006
Posts: 6
bella_11041988 is on a distinguished road
HI, SDE, thank you very much for your post, appreciate.

I have been reading for the XML tutorial for the past few days. I realized that I have two problems to be overcome.

1. My XML is not in a well-formed format. I would like to find out which section is wrong. Is there any web software to test or validate the XML? I tried the link below but I dont know why it cant work. Is there any other link to be used?
http://www.w3schools.com/dom/dom_validate.asp

2. From what I read, it specified that I should try to avoid the use of attributes if information feels like data, Use child elements if the information feels like data. In my case, many attributes are used and the information to be displayed are scoring data, means I should change the use of attributes to child elements? Do you mind to elaborate on how to change the use of attributes to child elements in the codes?
__________________
bella_11041988 is offline   Reply With Quote
Old 05-16-2006, 09:03 PM   #11 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
1. you can use a browser like firefox to view your xml. the browser will display an error message if your xml is bad.

paste an example of your xml in a post here. it will be easier to start up a discussion about the structure you use.
__________________
testing 1 2 3
sde is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 08:56 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle