Click here to Skip to main content
15,916,846 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionHow to modify XML file's Element and Attribute copying from another file using C# Pin
Nikkiee11-Jun-09 13:45
Nikkiee11-Jun-09 13:45 
QuestionXML/XSL Html table trouble Pin
Brian_Mitchell10-Jun-09 22:50
Brian_Mitchell10-Jun-09 22:50 
AnswerRe: XML/XSL Html table trouble Pin
George L. Jackson11-Jun-09 14:02
George L. Jackson11-Jun-09 14:02 
AnswerRe: XML/XSL Html table trouble Pin
Stuart Dootson11-Jun-09 22:58
professionalStuart Dootson11-Jun-09 22:58 
QuestionSerialization Invalid cast exception Pin
miniThomas10-Jun-09 20:39
miniThomas10-Jun-09 20:39 
AnswerCross Posted Pin
led mike11-Jun-09 4:39
led mike11-Jun-09 4:39 
QuestionPreserving white space in attribute values. (using MSXML) Pin
Maximilien9-Jun-09 7:25
Maximilien9-Jun-09 7:25 
AnswerRe: Preserving white space in attribute values. (using MSXML) Pin
Stuart Dootson9-Jun-09 13:44
professionalStuart Dootson9-Jun-09 13:44 
Maximilien wrote:
for example, in the following snippet, when preserveWhiteSpace is FALSE, the list count is 2 and when preserveWhiteSpace is TRUE, the list count if 5 (!)


That's because there are text nodes in the list - they're the manifestation of the whitespace that's been preserved from the source XML.

I'm not sure that the preserve whitespace option affects attribute values anyway...

Here's some quick test code I wrote that demonstrates correct whitespace handling in attribute values - the value of the arp attribute of the test element is correctly read with a trailing space:

#include "stdafx.h"

#import <progid:Msxml2.DOMDocument.6.0> named_guids
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{
   ::CoInitialize(0);
   MSXML2::IXMLDOMDocument3Ptr doc;
   doc.CreateInstance(MSXML2::CLSID_DOMDocument60);
   if (VARIANT_FALSE != doc->loadXML(_bstr_t(L"<test arp=\"test \">\n  Hello!\n</test>")))
   {
      MSXML2::IXMLDOMNodeListPtr nodes = doc->childNodes;
      MSXML2::IXMLDOMNodePtr thisNode = nodes->nextNode();

      if (thisNode)
         do 
         {
            std::cout << thisNode->nodeTypeString << " - " << thisNode->text << std::endl;
            MSXML2::IXMLDOMNamedNodeMapPtr attributes = thisNode->attributes;
            {
               MSXML2::IXMLDOMNodePtr thisAttribute = attributes->nextNode();
               if (thisAttribute)
                  do 
                  {
                     std::cout << "  " << thisAttribute->nodeName << " - \"" << _bstr_t(thisAttribute->nodeValue) << "\"" << std::endl;
                  } while (thisAttribute = attributes->nextNode());
            }

         } while (thisNode = nodes->nextNode());
   }
	return 0;
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Preserving white space in attribute values. (using MSXML) [modified] Pin
Maximilien10-Jun-09 3:26
Maximilien10-Jun-09 3:26 
QuestionXML / XSL Substring Pin
Brian_Mitchell8-Jun-09 6:16
Brian_Mitchell8-Jun-09 6:16 
AnswerRe: XML / XSL Substring Pin
Stuart Dootson8-Jun-09 23:10
professionalStuart Dootson8-Jun-09 23:10 
QuestionCSS... Pin
Jamal Abdul Nasir8-Jun-09 3:11
Jamal Abdul Nasir8-Jun-09 3:11 
AnswerRe: CSS... Pin
Christian Graus8-Jun-09 18:08
protectorChristian Graus8-Jun-09 18:08 
GeneralRe: CSS... Pin
Stuart Dootson8-Jun-09 22:27
professionalStuart Dootson8-Jun-09 22:27 
GeneralRe: CSS... Pin
Christian Graus9-Jun-09 11:17
protectorChristian Graus9-Jun-09 11:17 
GeneralRe: CSS... Pin
Stuart Dootson9-Jun-09 13:02
professionalStuart Dootson9-Jun-09 13:02 
AnswerRe: CSS... Pin
Stuart Dootson8-Jun-09 22:25
professionalStuart Dootson8-Jun-09 22:25 
GeneralRe: CSS... Pin
Jamal Abdul Nasir2-Feb-10 7:58
Jamal Abdul Nasir2-Feb-10 7:58 
QuestionAnother boring XML question. URGENT Pin
Etienne_1237-Jun-09 6:15
Etienne_1237-Jun-09 6:15 
AnswerRe: Another boring XML question. URGENT Pin
Christian Graus8-Jun-09 18:07
protectorChristian Graus8-Jun-09 18:07 
GeneralRe: Another boring XML question. URGENT Pin
Etienne_1238-Jun-09 23:00
Etienne_1238-Jun-09 23:00 
GeneralRe: Another boring XML question. URGENT Pin
Christian Graus9-Jun-09 14:54
protectorChristian Graus9-Jun-09 14:54 
AnswerRe: Another boring XML question. URGENT Pin
kamagra10-Jun-09 2:10
kamagra10-Jun-09 2:10 
QuestionHow do I specify a new Uri path? Pin
Etienne_1234-Jun-09 4:56
Etienne_1234-Jun-09 4:56 
QuestionBinding TreeView Header to XML Nodes Pin
Etienne_1234-Jun-09 0:49
Etienne_1234-Jun-09 0:49 

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.