<PAGE/>
<FLEXREPORT/>
:(
应该是<PAGE></PAGE>这样的

解决方案 »

  1.   

    这是正确的写法,你可以查查任何讲xml的书,它都会这样告诉你,像这种没有正文的结点
    <tagname attr .... ></tagname> 是可以简写为<tagname attr .... />的,M$别的不咋的,这个写法很标准的。
      

  2.   

    这个问题你竟然给了200分,满大方的,还没注意,呵呵呵呵,大家有空帮我看看:
    分数由你定: http://www.csdn.net/expert/topic/503/503163.shtm 
      

  3.   

    写成<PAGE/> IE编译没问题。判断XML是否legal,拿给IE编译一下就知。
      

  4.   

    <PAGE>这里没有内容</PAGE>
    则可以<PAGE/>
      

  5.   

    那偶怎么读不出来?
    COleVariant var=lpszPathName;
    pXMLDOMDocument2.load(var);
    CXMLDOMElement pPage=pXMLDOMDocument2.selectSingleNode("PAGE");
    if(pPage.m_lpDispatch){//这里没有读到<PAGE>啊
    .....
    }
      

  6.   

    <?xml version='1.0'?>
    <FLEXPEPORT>
    <PAGE>
    <RH>some text
    </RH>
    <PH>some text
    </PH>
    <B>some text
    </B>
    <RF>some text
    </RF>
    <PH>some text
    </PH>
    </PAGE>
    这样的也读不出来啊
    </FLEXPEPORT>
    这样的也读不出来啊
      

  7.   

    不知那个pPage.m_lpDispatch是干什么的东西。
    <farther>
     <child>ty54t4wetfew</child>
    </farther>如是取得节点间的text话,farther见只有节点,没有text。还有,你的各个element的声明呢???
      

  8.   

    Class Wizard->Add Class->From A Type Library->msxml4.dll
    CXMLDOMxxx都是COleDispatchDriver派生出来的
    那我怎么得到<PAGE>这个节点?
      

  9.   

    // Machine generated IDispatch wrapper class(es) created with ClassWizard
    /////////////////////////////////////////////////////////////////////////////
    // CXMLDOMNode wrapper classclass CXMLDOMElement : public COleDispatchDriver
    ……
    selectSingleNode 好像要一个XPath路径?
      

  10.   

    你的 selectSingleNode("PAGE") 用法好像不怎么地道,参考参考msdn。实在不行,你还可以遍历所有结点嘛。
    为什么不用 ATL 封装的类,MFC的难看死了。selectSingleNode Method  [C/C++]
    Applies the specified pattern-matching operation to this node's context and returns the first matching node.Res
    For a complete description of XML Path Language (XPath) syntax, see XPath Syntax.The selectSingleNode method is similar to the selectNodes method, but returns only the first matching node rather than the list of all matching nodes.This member is an extension of the Worldwide Web Consortium (W3C) Document Object Model (DOM).
    XPath Examples
    This topic reviews the examples that appear throughout this documentation. All are based on the Sample Data.Find all author elements within the current context../author
    Note that this is equivalent to the following.author
    Find all first.name elements.first.name
    Find the document element (bookstore) of this document./bookstore
    Find all author elements that are children of the current context node (for example, /bookstore/book).//author
    Find all bookstores where the value of the specialty attribute is equal to "textbooks"./bookstore[@specialty = "textbooks"]
    Find all books where the value of the style attribute on the book is equal to the value of the specialty attribute of the bookstore element at the root of the document.book[/bookstore/@specialty = @style]
    Find all first-name elements within an author element. Note that the author children of the current context are found, and then first-name children are found relative to the context of the author elements.author/first-name
    Find all title elements one or more levels deep in the bookstore (arbitrary descendants).bookstore//title
    Note that this is different from the following pattern, which finds all title elements that are grandchildren of bookstore elements.bookstore/*/title
    Find emph elements anywhere inside book excerpts, anywhere inside the bookstore.bookstore//book/excerpt//emph
    Find all titles one or more levels deep in the current context. Note that this situation is essentially the only one in which the period notation is required..//title
    Find all element children of author elements.author/*
    Find all last names that are grandchildren of books.book/*/last-name
    Find the grandchildren elements of the current context.*/*
    Find the book element from the "my" namespace.my:book
    Find all elements from the "my" namespace.my:*
    Find all elements with the specialty attribute.*[@specialty]
    Find the style attribute of the current element context.@style
    Find the exchange attribute on price elements within the current context.price/@exchange
    The following example does not return anything because attributes do not contain element children. It is allowed by the XML Path Language (XPath) grammar, but is not strictly valid.price/@exchange/total
    Find all books with style attributes.book[@style]
    Find the style attribute for all book elements.book/@style
    Find all attributes of the current element context.@*
    Find all attributes from the "my" namespace. This does not include unqualified attributes on elements from the "my" namespace.@my:*
    Find all first-name elements. The following examples are equivalent../first-name
    first-name
    Find all unqualified book elements.book
    For example, the following finds the first author element.author[1]
    The following finds the third author element that has a first-name.author[first-name][3]
    Note that indexes are relative to the parent. Consider the following data.
      

  11.   

    搞定了,用GetDocumentElement,然后遍历子节点树
    但是现在还不知道怎么用Xpath访问:(