[ http://issues.apache.org/jira/browse/XERCESC-1355?page=history ]
     
Alberto Massari resolved XERCESC-1355:
--------------------------------------

    Resolution: Invalid

There is a programming error in the code, inside buildCLISubTree: the call to 

buildCLISubTree(n->getNextSibling(), depth++);

should be done also for elements, or you will only navigate through the first 
child element, skipping its sibling. 

Once I fixed this, I got this output, that I believe is what you want to obtain:

Building CLI tree from data model ...
Element: cli-model
        Attributes
        ----------
        id=_1
        name=bulk-input
Rootnode has child: 1
Element: help = (null) with type 1
Element: command = (null) with type 1
        Attributes
        ----------
        id=_1
        name=show
Element: command = (null) with type 1
        Attributes
        ----------
        id=_2
        name=start
Node type == 1
Element: help and value (null) at 0
Node type == 3
Element: #text and value "BulkInputService" at 0
Node type == 1
Element: command and value (null) at 1
        Attributes
        ----------
        id=_1
        name=show
Node type == 1
Element: help and value (null) at 1
Node type == 3
Element: #text and value "Show a Command" at 1
Node type == 1
Element: flags and value (null) at 2
Node type == 3
Element: #text and value "tada" at 2
Node type == 1
Element: callback and value (null) at 3
Node type == 3
Element: #text and value "GenericCallbackHandler" at 3
Node type == 1
Element: description and value (null) at 4
Node type == 3
Element: #text and value "Tada" at 4
Node type == 1
Element: parameter-set and value (null) at 5
Node type == 1
Element: parameter and value (null) at 5
        Attributes
        ----------
        id=_2
        name=all
Node type == 1
Element: data and value (null) at 5
        Attributes
        ----------
        type=KEYWORD
Node type == 1
Element: size and value (null) at 5
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: parameter-set and value (null) at 6
Node type == 1
Element: parameter and value (null) at 6
        Attributes
        ----------
        id=_3
        name=bulk-input-name
Node type == 1
Element: data and value (null) at 6
        Attributes
        ----------
        type=STRING
Node type == 1
Element: size and value (null) at 6
Node type == 3
Element: #text and value "12" at 6
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: flags and value (null) at 2
Node type == 3
Element: #text and value "tada" at 2
Node type == 1
Element: callback and value (null) at 3
Node type == 3
Element: #text and value "GenericCallbackHandler" at 3
Node type == 1
Element: description and value (null) at 4
Node type == 3
Element: #text and value "Tada" at 4
Node type == 1
Element: parameter-set and value (null) at 5
Node type == 1
Element: parameter and value (null) at 5
        Attributes
        ----------
        id=_2
        name=all
Node type == 1
Element: data and value (null) at 5
        Attributes
        ----------
        type=KEYWORD
Node type == 1
Element: size and value (null) at 5
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: parameter-set and value (null) at 6
Node type == 1
Element: parameter and value (null) at 6
        Attributes
        ----------
        id=_3
        name=bulk-input-name
Node type == 1
Element: data and value (null) at 6
        Attributes
        ----------
        type=STRING
Node type == 1
Element: size and value (null) at 6
Node type == 3
Element: #text and value "12" at 6
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: callback and value (null) at 3
Node type == 3
Element: #text and value "GenericCallbackHandler" at 3
Node type == 1
Element: description and value (null) at 4
Node type == 3
Element: #text and value "Tada" at 4
Node type == 1
Element: parameter-set and value (null) at 5
Node type == 1
Element: parameter and value (null) at 5
        Attributes
        ----------
        id=_2
        name=all
Node type == 1
Element: data and value (null) at 5
        Attributes
        ----------
        type=KEYWORD
Node type == 1
Element: size and value (null) at 5
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: parameter-set and value (null) at 6
Node type == 1
Element: parameter and value (null) at 6
        Attributes
        ----------
        id=_3
        name=bulk-input-name
Node type == 1
Element: data and value (null) at 6
        Attributes
        ----------
        type=STRING
Node type == 1
Element: size and value (null) at 6
Node type == 3
Element: #text and value "12" at 6
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: description and value (null) at 4
Node type == 3
Element: #text and value "Tada" at 4
Node type == 1
Element: parameter-set and value (null) at 5
Node type == 1
Element: parameter and value (null) at 5
        Attributes
        ----------
        id=_2
        name=all
Node type == 1
Element: data and value (null) at 5
        Attributes
        ----------
        type=KEYWORD
Node type == 1
Element: size and value (null) at 5
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: parameter-set and value (null) at 6
Node type == 1
Element: parameter and value (null) at 6
        Attributes
        ----------
        id=_3
        name=bulk-input-name
Node type == 1
Element: data and value (null) at 6
        Attributes
        ----------
        type=STRING
Node type == 1
Element: size and value (null) at 6
Node type == 3
Element: #text and value "12" at 6
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: parameter-set and value (null) at 5
Node type == 1
Element: parameter and value (null) at 5
        Attributes
        ----------
        id=_2
        name=all
Node type == 1
Element: data and value (null) at 5
        Attributes
        ----------
        type=KEYWORD
Node type == 1
Element: size and value (null) at 5
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: help and value (null) at 6
Node type == 3
Element: #text and value "show everything" at 6
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: flags and value (null) at 7
Node type == 1
Element: description and value (null) at 7
Node type == 3
Element: #text and value "Tada" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: parameter-set and value (null) at 6
Node type == 1
Element: parameter and value (null) at 6
        Attributes
        ----------
        id=_3
        name=bulk-input-name
Node type == 1
Element: data and value (null) at 6
        Attributes
        ----------
        type=STRING
Node type == 1
Element: size and value (null) at 6
Node type == 3
Element: #text and value "12" at 6
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: parameter-set and value (null) at 6
Node type == 1
Element: parameter and value (null) at 6
        Attributes
        ----------
        id=_3
        name=bulk-input-name
Node type == 1
Element: data and value (null) at 6
        Attributes
        ----------
        type=STRING
Node type == 1
Element: size and value (null) at 6
Node type == 3
Element: #text and value "12" at 6
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "specific bulk-name" at 7
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: description and value (null) at 8
Node type == 3
Element: #text and value "Tada" at 8
Node type == 1
Element: command and value (null) at 7
        Attributes
        ----------
        id=_2
        name=start
Node type == 1
Element: help and value (null) at 7
Node type == 3
Element: #text and value "start a bulk service" at 7
Node type == 1
Element: flags and value (null) at 8
Node type == 1
Element: callback and value (null) at 8
Node type == 3
Element: #text and value "GenericCallbackHandler" at 8
Node type == 1
Element: description and value (null) at 9
Node type == 1
Element: flags and value (null) at 8
Node type == 1
Element: callback and value (null) at 8
Node type == 3
Element: #text and value "GenericCallbackHandler" at 8
Node type == 1
Element: description and value (null) at 9
Node type == 1
Element: callback and value (null) at 9
Node type == 3
Element: #text and value "GenericCallbackHandler" at 9
Node type == 1
Element: description and value (null) at 10
Node type == 1
Element: description and value (null) at 10
cli.xml: 10 ms (0 elems).


Alberto

> DOMBuilder parse wrong node type
> --------------------------------
>
>          Key: XERCESC-1355
>          URL: http://issues.apache.org/jira/browse/XERCESC-1355
>      Project: Xerces-C++
>         Type: Bug
>   Components: DOM
>     Versions: 2.6.0
>  Environment: Linux gcc 3.2 Redhat Linux 8.0 3.2-7
>     Reporter: Vu Nguyen
>  Attachments: testcase.zip
>
> Basically I wrote a simple code (similar to DOMCount) to printout the DOM 
> tree content. I found out that all of the node type (node.getNodeType()) 
> always return  3(which is ELEMENT_NODE) while it should sometimes return 
> TEXT_NODE so I can obtain the value via node.getNodeValue(). As the result, I 
> always get NULL.
> Not sure if related to this thing, before setFeature(...whitespace = true), 
> the DOMTree has a lot of bogus TEXT_NODEs.
> ==================== OUTPUT LOG =========================
> Building CLI tree from data model ... 
> Element: command-groups 
>         Attributes 
>         ---------- 
>         id=_1 
>         name=bulk-input 
> Rootnode has child: 1 
> Element: help = (null) with type 1 
> Element: command = (null) with type 1 
>         Attributes 
>         ---------- 
>         id=_1 
>         name=show 
> Element: command = (null) with type 1 
>         Attributes 
>         ---------- 
>         id=_2 
>         name=start 
> Node type == 1 
> Element: help and value (null) at 0 
> Node type == 3 
> we done 
> =============================================================
> Note that: help is a text node and expected to return some value.
> Here the sample of xml and dtd.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to