Click here to Skip to main content
16,006,845 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: Editable XML from MSXML Pin
Michael A. Barnhart28-Mar-02 11:18
Michael A. Barnhart28-Mar-02 11:18 
GeneralRe: Editable XML from MSXML Pin
Michael A. Barnhart28-Mar-02 11:02
Michael A. Barnhart28-Mar-02 11:02 
GeneralRe: Editable XML from MSXML Pin
David Chamberlain28-Mar-02 11:29
David Chamberlain28-Mar-02 11:29 
GeneralRe: Editable XML from MSXML Pin
Michael A. Barnhart28-Mar-02 11:38
Michael A. Barnhart28-Mar-02 11:38 
GeneralRe: Editable XML from MSXML Pin
David Chamberlain28-Mar-02 11:59
David Chamberlain28-Mar-02 11:59 
GeneralRe: Editable XML from MSXML Pin
Michael A. Barnhart28-Mar-02 15:13
Michael A. Barnhart28-Mar-02 15:13 
GeneralRe: Editable XML from MSXML Pin
Michael A. Barnhart28-Mar-02 16:53
Michael A. Barnhart28-Mar-02 16:53 
GeneralRe: Editable XML from MSXML Pin
David Chamberlain29-Mar-02 3:02
David Chamberlain29-Mar-02 3:02 
Michael A. Barnhart wrote:
However, because this information is lost, an XML document stored in this manner can lose formatting information in its content.

First, I sure didn't expect such investigation into this seemingly trivial matter, but I certainly appreciate all the input and help.

Apparently, the preserve white space option is on by default. I had created an XML file in the Visual Studio IDE in order to plan out the structure and content of the file that would eventually be manipulated and maintained by the application program. Once I had that file, I would call the 'load' function, and then let the application do its thing, one operation being the creation of new nodes, as described in the earlier posts. At the end of execution, and calling 'save', I would then load the file back into the IDE to see what happened, and to check that the application created the new nodes properly.

At that point, what I was seeing was the same file as I had originally created, with all the 'formatting' (spaces, tabs, and newlines) properly still existant, but the new nodes would appear on a single line. They would be in the proper location in the file, in terms of being after the last child of the node being added to, but there were no new lines.

Therefore, although I haven't updated the implementation yet, I believe that the previous suggestion about adding text nodes with newlines (and spaces or tabs if I decide to add those too) will indeed place those into the file and will be preserved upon subsequent 'load' and 'save' operations, by default, even without calling 'preserve white space'.

This particular application is running on Win98 with msxml3, although I plan to update that to msxml4 for the speed and memory considerations.

I also appreciate your code, as seeing how things are done is the best teacher. But, unfortunately, and probably as no surprise, that raises a few more questions.

Based on one of the XML sample projects on CP, I am using the #import [msxml3.dll] in the header file. While it seems to me that the following should be equivalent, one worked and one did not. While I am not familiar with the intricacies of COM, I went with the one that worked.

(1) IXMLDOMNode *pNode;
pNode = m_pXmlDoc->selectNode ("StartTag");

(2) IXMLDOMNodePtr pNode;
pNode = m_pXmlDoc->selectNode ("StartTag");

According to the contents of the generated .tlh file, the selectNode function returns an IXMLDOMNodePtr, and option 1 bombs. While I don't really understand the internal difference, by following the .tlh contents, I was able to get all of the function calls and return values to be of the proper type and operate without bombing. I guess there is not really a question here, other than does this really make any difference, or am I going down a wrong path?

Thanks again for all the help.

Dave



"You can say that again." -- Dept. of Redundancy Dept.
GeneralRe: Editable XML from MSXML Pin
Michael A. Barnhart29-Mar-02 3:14
Michael A. Barnhart29-Mar-02 3:14 
QuestionParsing takes too long - How to speed-up??? Pin
Rybeck25-Mar-02 6:29
Rybeck25-Mar-02 6:29 
AnswerRe: Parsing takes too long - How to speed-up??? Pin
Michael A. Barnhart27-Mar-02 11:44
Michael A. Barnhart27-Mar-02 11:44 
GeneralAn interesting example Pin
Michael A. Barnhart21-Mar-02 15:22
Michael A. Barnhart21-Mar-02 15:22 
GeneralXSLT to write links Pin
MS le Roux17-Mar-02 23:06
MS le Roux17-Mar-02 23:06 
GeneralRe: XSLT to write links Pin
David Wengier17-Mar-02 23:45
David Wengier17-Mar-02 23:45 
GeneralRe: XSLT to write links Pin
MS le Roux18-Mar-02 5:00
MS le Roux18-Mar-02 5:00 
GeneralRe: XSLT to write links Pin
Paul Watson20-Mar-02 22:12
sitebuilderPaul Watson20-Mar-02 22:12 
GeneralRe: XSLT to write links Pin
Atlantys8-Apr-02 6:26
Atlantys8-Apr-02 6:26 
GeneralTrying to write a filter Pin
Christian Graus13-Mar-02 9:41
protectorChristian Graus13-Mar-02 9:41 
GeneralRe: Trying to write a filter Pin
MS le Roux13-Mar-02 19:08
MS le Roux13-Mar-02 19:08 
GeneralRe: Trying to write a filter Pin
Christian Graus13-Mar-02 20:28
protectorChristian Graus13-Mar-02 20:28 
GeneralRe: Trying to write a filter Pin
Paul Watson14-Mar-02 0:46
sitebuilderPaul Watson14-Mar-02 0:46 
GeneralRe: Trying to write a filter Pin
Michael A. Barnhart14-Mar-02 0:53
Michael A. Barnhart14-Mar-02 0:53 
GeneralRe: Trying to write a filter Pin
Christian Graus14-Mar-02 3:12
protectorChristian Graus14-Mar-02 3:12 
GeneralVoice XML Pin
Adrian Metcalfe13-Mar-02 5:36
Adrian Metcalfe13-Mar-02 5:36 
GeneralRe: Voice XML Pin
Jamie Hale28-Mar-02 11:05
Jamie Hale28-Mar-02 11:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.