Results 1 to 2 of 2

Thread: QDomElement::elementsByTagName()

  1. #1
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default QDomElement::elementsByTagName()

    Hi,

    I have an xml document having nested tags with same name. When I try to get a list of tags with using elementsByTagName() functions from QDomElement, it return me a list of all elements (including the nested ones in preorder traversal method). I only want the list of direct children with name "Page". Can someone please tell me how to do that??

    Here follows the a sample portion of xml file:

    <Root>
    <PageCount>5</PageCount>
    <Page Type="C">
    <Pos>10</Pos>
    <Page Type="L">
    --------
    --------
    </Page>
    <Page Type="R">
    --------
    --------
    </Page>
    -------
    -------
    </Page>
    <Page Type="D">
    <Pos>10</Pos>
    <Page Type="L">
    --------
    --------
    </Page>
    <Page Type="R">
    --------
    --------
    </Page>
    -------
    -------
    </Page>
    <Page Type="M">
    <Pos>10</Pos>
    <Page Type="L">
    --------
    --------
    </Page>
    <Page Type="R">
    --------
    --------
    </Page>
    -------
    -------
    </Page>
    <Page Type="D">
    <Pos>10</Pos>
    <Page Type="L">
    --------
    --------
    </Page>
    <Page Type="R">
    --------
    --------
    </Page>
    -------
    -------
    </Page>
    <Page Type="L">
    <Pos>10</Pos>
    <Page Type="L">
    --------
    --------
    </Page>
    <Page Type="R">
    --------
    --------
    </Page>
    -------
    -------
    </Page>
    </Root>

    Regards,
    Manoj

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDomElement::elementsByTagName()


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.