Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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 childrens 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:
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.

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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 childrens 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:
    : 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.
    :
    :
    The easiest way to read a specific XML format is to write a string parser for it. If you plan to alter the format of your history files, then you might consider calling the MSXML.DLL to perform the parsing.
    As for the XML mess, you should either add some indentation and line endings (if you write the XML file yourself) or use another XML writing algorithm (if you're depending on a 3rd-party writer).
  • infidelinfidel Posts: 2,900Member
    : 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.

    I don't do C++, so I can't help there. I can help with the XML format, though. Can you post an example of the XML data you have to work with so we can provide suggestions?


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • bella_11041988bella_11041988 Posts: 4Member
    : : 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.
    :
    : I don't do C++, so I can't help there. I can help with the XML format, though. Can you post an example of the XML data you have to work with so we can provide suggestions?
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :

    Hi, Infidel, thank you very much for your reply, appreciate.

    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.

    [code]
    tyty

















    [code]

    I really need your help at this very beginning, please help, please.

  • bella_11041988bella_11041988 Posts: 4Member
    : : 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 childrens 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:
    : : 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.
    : :
    : :
    : The easiest way to read a specific XML format is to write a string parser for it. If you plan to alter the format of your history files, then you might consider calling the MSXML.DLL to perform the parsing.
    : As for the XML mess, you should either add some indentation and line endings (if you write the XML file yourself) or use another XML writing algorithm (if you're depending on a 3rd-party writer).
    :

    Hi, Zibadian, thanks so much for your reply, appreciate.

    Sorry, I dont understand what you mean by calling the MSXML.dll. Could you pelase elaborate a little bit more?
    I have four XML cpp files, one of them is the xmlParser.cpp. YOu mean I can add spacing or lines in the XML file? I thought it is impossible to do this,Please forgive me if I am wrong.
  • zibadianzibadian Posts: 6,349Member
    : : : 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 childrens 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:
    : : : 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.
    : : :
    : : :
    : : The easiest way to read a specific XML format is to write a string parser for it. If you plan to alter the format of your history files, then you might consider calling the MSXML.DLL to perform the parsing.
    : : As for the XML mess, you should either add some indentation and line endings (if you write the XML file yourself) or use another XML writing algorithm (if you're depending on a 3rd-party writer).
    : :
    :
    : Hi, Zibadian, thanks so much for your reply, appreciate.
    :
    : Sorry, I dont understand what you mean by calling the MSXML.dll. Could you pelase elaborate a little bit more?
    : I have four XML cpp files, one of them is the xmlParser.cpp. YOu mean I can add spacing or lines in the XML file? I thought it is impossible to do this,Please forgive me if I am wrong.
    :
    You may add spaces, tabs, comments to XML as you like (see http://www.w3schools.com/xml/default.asp for more info and examples).
    MSXML.DLL is a standard library which comes with windows. I don't program in C, so I cannot give you any code how to call external routines. The MSXML.DLL library implements a number of interfaces, which can be used to read/write XML files in an object-tree structure, where each branch of the XML file is represented by an IXMLDOMNode interface instance.
  • bella_11041988bella_11041988 Posts: 4Member
    : : : : 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 childrens 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:
    : : : : 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.
    : : : :
    : : : :
    : : : The easiest way to read a specific XML format is to write a string parser for it. If you plan to alter the format of your history files, then you might consider calling the MSXML.DLL to perform the parsing.
    : : : As for the XML mess, you should either add some indentation and line endings (if you write the XML file yourself) or use another XML writing algorithm (if you're depending on a 3rd-party writer).
    : : :
    : :
    : : Hi, Zibadian, thanks so much for your reply, appreciate.
    : :
    : : Sorry, I dont understand what you mean by calling the MSXML.dll. Could you pelase elaborate a little bit more?
    : : I have four XML cpp files, one of them is the xmlParser.cpp. YOu mean I can add spacing or lines in the XML file? I thought it is impossible to do this,Please forgive me if I am wrong.
    : :
    : You may add spaces, tabs, comments to XML as you like (see http://www.w3schools.com/xml/default.asp for more info and examples).
    : MSXML.DLL is a standard library which comes with windows. I don't program in C, so I cannot give you any code how to call external routines. The MSXML.DLL library implements a number of interfaces, which can be used to read/write XML files in an object-tree structure, where each branch of the XML file is represented by an IXMLDOMNode interface instance.
    :


    Hi, Zibadian, thank you very much for your reply, appreciate.

    I will try now and let you know how I am going.

    Thanks so much.
  • infidelinfidel Posts: 2,900Member
    Well, not knowing how the data is used or exactly what it represents, I can only offer vague suggestions. Here is one way you might make the data more hierarchical:

    [code]
    <?xml version="1.0"?>









    [/code]

    Bear in mind that any changes to the format will require code changes where the XML is processed or created.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • cindy_16051988cindy_16051988 Posts: 5Member
    : Well, not knowing how the data is used or exactly what it represents, I can only offer vague suggestions. Here is one way you might make the data more hierarchical:
    :
    : [code]
    : <?xml version="1.0"?>
    :
    :
    :
    :
    :
    :
    :
    :
    :
    : [/code]
    :
    : Bear in mind that any changes to the format will require code changes where the XML is processed or created.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :

    HI,

    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?
  • zibadianzibadian Posts: 6,349Member
    : : Well, not knowing how the data is used or exactly what it represents, I can only offer vague suggestions. Here is one way you might make the data more hierarchical:
    : :
    : : [code]
    : : <?xml version="1.0"?>
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : : [/code]
    : :
    : : Bear in mind that any changes to the format will require code changes where the XML is processed or created.
    : :
    : :
    : : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    : :
    : : [code]
    : : $ select * from users where clue > 0
    : : no rows returned
    : : [/code]
    : :
    : :
    :
    : HI,
    :
    : 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?
    :
    2: here is an example of the technique using child elements:
    [code]


    1
    2006-04-27
    16:12:21
    80
    62
    28
    46
    54

    [/code]
    The same can be done using the Sentence nodes.
Sign In or Register to comment.