Click here to Skip to main content
15,887,821 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Add GIF file as resource? Pin
Don Box12-Dec-07 17:47
Don Box12-Dec-07 17:47 
AnswerRe: Add GIF file as resource? Pin
KarstenK13-Dec-07 4:46
mveKarstenK13-Dec-07 4:46 
GeneralWinerror 234 Pin
RomTibi12-Dec-07 10:36
RomTibi12-Dec-07 10:36 
GeneralRe: Winerror 234 Pin
CPallini12-Dec-07 10:47
mveCPallini12-Dec-07 10:47 
GeneralRe: Winerror 234 Pin
RomTibi13-Dec-07 8:01
RomTibi13-Dec-07 8:01 
GeneralRe: Winerror 234 Pin
CPallini13-Dec-07 21:12
mveCPallini13-Dec-07 21:12 
GeneralRe: Winerror 234 Pin
RomTibi14-Dec-07 6:08
RomTibi14-Dec-07 6:08 
GeneralXML Reading/Skipping comments question. Pin
Maximilien12-Dec-07 10:16
Maximilien12-Dec-07 10:16 
(I don't know if I should post this in the XML forum or here, I flipped the coin and it falls here)

I have a comment in in a section of an XML like :

<Command id="myCommand">
  <!-- ... this is a comment -->
  <Data name="X1"></Data>
  <Data name="X2"></Data>
  <Data name="X3"></Data>
  <Data name="X4"></Data>
  <Data name="X5"></Data>
</Command>


I parse the XML with something like that :

MSXML2::IXMLDOMNodeListPtr	pXMLNodeList;
long lCount;
HRESULT hr;
hr = pXMLNode->get_childNodes(&pXMLNodeList);
hr = pXMLNodeList->get_length(&lCount);
if (FAILED(hr))
{
  ASSERT( 0 );
  return;
}

for (int i = 0; i < lCount; i++)
{
  MSXML2::IXMLDOMNodePtr pXMLNode;
  hr = pXMLNodeList->get_item(i, &pXMLNode);
  if (FAILED(hr))
  {
    ASSERT( 0 );
    return;
  }

  CString stmp = MyParser::GetnodeName(pXMLNode );
  if ( stmp.Compare( "Data" ) == 0 )
  {
    TRACE("Tata\n");
  }
}


When I read the count with pXMLNodeList->get_length(&lCount); it returns 6, the 5 <Data> and the comment line.

When I do the MyParser::GetnodeName(pXMLNode ); for the comment line it returns "#comment"

I'm not certain if it's normal and if there is a better when than doing a Compare to skip the comment line ?

Thanks.

Max.




Maximilien Lincourt
Your Head A Splode - Strong Bad

GeneralRe: XML Reading/Skipping comments question. Pin
George L. Jackson12-Dec-07 12:59
George L. Jackson12-Dec-07 12:59 
GeneralDeploying a simple VS2005 executable Pin
bigdenny20012-Dec-07 9:08
bigdenny20012-Dec-07 9:08 
GeneralRe: Deploying a simple VS2005 executable Pin
Wes Aday12-Dec-07 9:20
professionalWes Aday12-Dec-07 9:20 
GeneralRe: Deploying a simple VS2005 executable Pin
Mark Salsbery12-Dec-07 9:21
Mark Salsbery12-Dec-07 9:21 
GeneralRe: Deploying a simple VS2005 executable Pin
ThatsAlok12-Dec-07 22:19
ThatsAlok12-Dec-07 22:19 
Generalweb browser control in win32 application Pin
s196675m12-Dec-07 7:23
s196675m12-Dec-07 7:23 
GeneralRe: web browser control in win32 application Pin
led mike12-Dec-07 7:58
led mike12-Dec-07 7:58 
GeneralRe: web browser control in win32 application Pin
Mark Salsbery12-Dec-07 9:36
Mark Salsbery12-Dec-07 9:36 
QuestionGetting file system parent from LPITEMLIST? Pin
Jerry Evans12-Dec-07 4:40
Jerry Evans12-Dec-07 4:40 
AnswerRe: Getting file system parent from LPITEMLIST? Pin
Roger Broomfield12-Dec-07 16:48
Roger Broomfield12-Dec-07 16:48 
GeneralRe: Getting file system parent from LPITEMLIST? Pin
Jerry Evans13-Dec-07 0:45
Jerry Evans13-Dec-07 0:45 
GeneralXP style look Pin
josip cagalj12-Dec-07 2:06
josip cagalj12-Dec-07 2:06 
GeneralRe: XP style look Pin
toxcct12-Dec-07 2:24
toxcct12-Dec-07 2:24 
GeneralRe: XP style look Pin
Jeremy Falcon12-Dec-07 4:13
professionalJeremy Falcon12-Dec-07 4:13 
GeneralRe: XP style look Pin
Dr. Emmett Brown12-Dec-07 6:05
Dr. Emmett Brown12-Dec-07 6:05 
GeneralRe: XP style look [modified] Pin
josip cagalj13-Dec-07 1:34
josip cagalj13-Dec-07 1:34 
GeneralRe: XP style look Pin
josip cagalj12-Dec-07 23:25
josip cagalj12-Dec-07 23:25 

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.