You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Smith, Cynthia J" <Cy...@West.Boeing.com> on 2001/09/14 05:58:02 UTC

IDOM getElementsByTagName

I have not had any luck using getElementsByTagName for either an
IDOM_Element* or for an IDOM_Document*.  For example, the following fails
for an IDOM_Document.  

   IDOM_Document* pXMLDocument = parser.getDocument();
   unsigned int elementCount = 
      pXMLDocument->getElementsByTagName( XMLString::transcode( "*" ) )
         ->getLength();
   cout << "number of elements is " << elementCount << endl;

The code was borrowed from the sample program DOMCount (complete source is
attached at end).  The call to getLength never returns.  I have also tried
using specific tagNames.  Similar calls using an IDOM_Element* also fail in
the same manner.

Has anyone had any success with the IDOM versions of getElementsByTagName?
If so, on what platform?  We are building on VxWorks targeted for the
PowerPC (PPC604 and PPC603). 

Thanks for the help,

Cindy Smith
cynthia.j.smith@boeing.com
> Battle Management Command, Control and Communications (BMC3) & Strategic
> Systems
> Network Communications Systems, Anaheim, CA
714-762-9241 (work)
714-762-1263 (fax)

 <<loadXMLFile.cpp>> 

Re: IDOM getElementsByTagName

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Tinny Ng" <tn...@ca.ibm.com> writes:

> Are you using the latest nightly build?  If not, if try the latest
> nightly build (http://xml.apache.org/dist/xerces-c/nightly/) and
> please let us know if problem persists.

Hey Tinny,

This works correctly for the latest nightly build under all my tests,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: IDOM getElementsByTagName

Posted by "Peter A. Volchek" <Pe...@ti.com.od.ua>.
> To: Smith, Cynthia
> Also note, that XMLString::transcode( "*" )  is obsolete. Just "*" will be
> enough

Ignore this. I did not notice that you are talking about IDOM_  interface.
&chAsterisk may be used instead.


>> If so, on what platform?  We are building on VxWorks targeted for the
>> PowerPC (PPC604 and PPC603).

>Are you using the latest nightly build?  If not, if try the latest nightly
build
>(http://xml.apache.org/dist/xerces-c/nightly/) and please let us know if
problem persists.
> Tinny


I rebuilt the latest night build (on NT) and run modified IDOMCount sample
(see attachment) with
getElementsByTagName() call.
All went without problems. So, the platform may be issue.


Peter A. Volchek


Re: IDOM getElementsByTagName

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Peter A. Volchek" <Pe...@ti.com.od.ua> writes:

> Could you remind me, whether getElementsByTagName() is applied to
> Document.  I thought this is for Element only.

It works for both,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: IDOM getElementsByTagName

Posted by "Peter A. Volchek" <Pe...@ti.com.od.ua>.
> Are you using the latest nightly build?  If not, if try the latest nightly
build
> (http://xml.apache.org/dist/xerces-c/nightly/) and please let us know if
problem persists.
>

> "Smith, Cynthia J" wrote:
> >       pXMLDocument->getElementsByTagName( XMLString::transcode( "*" ) )
> >          ->getLength();


To: Smith, Cynthia
Also note, that XMLString::transcode( "*" )  is obsolete. Just "*" will be
enough

To: Xerces Developer team
Could you remind me, whether getElementsByTagName() is applied to Document.
I thought this is for Element only.


Peter A. Volchek
Software Engineer
Metis International, Inc.
PeterV@ti.com.od.ua


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: IDOM getElementsByTagName

Posted by Tinny Ng <tn...@ca.ibm.com>.
Are you using the latest nightly build?  If not, if try the latest nightly build
(http://xml.apache.org/dist/xerces-c/nightly/) and please let us know if problem persists.

Tinny

"Smith, Cynthia J" wrote:

> I have not had any luck using getElementsByTagName for either an
> IDOM_Element* or for an IDOM_Document*.  For example, the following fails
> for an IDOM_Document.
>
>    IDOM_Document* pXMLDocument = parser.getDocument();
>    unsigned int elementCount =
>       pXMLDocument->getElementsByTagName( XMLString::transcode( "*" ) )
>          ->getLength();
>    cout << "number of elements is " << elementCount << endl;
>
> The code was borrowed from the sample program DOMCount (complete source is
> attached at end).  The call to getLength never returns.  I have also tried
> using specific tagNames.  Similar calls using an IDOM_Element* also fail in
> the same manner.
>
> Has anyone had any success with the IDOM versions of getElementsByTagName?
> If so, on what platform?  We are building on VxWorks targeted for the
> PowerPC (PPC604 and PPC603).
>
> Thanks for the help,
>
> Cindy Smith
> cynthia.j.smith@boeing.com
> > Battle Management Command, Control and Communications (BMC3) & Strategic
> > Systems
> > Network Communications Systems, Anaheim, CA
> 714-762-9241 (work)
> 714-762-1263 (fax)
>
>  <<loadXMLFile.cpp>>
>
>   ------------------------------------------------------------------------
>                       Name: loadXMLFile.cpp
>    loadXMLFile.cpp    Type: C++ source files (application/x-unknown-content-type-cpp_auto_file)
>                   Encoding: base64
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org