I am assuming you mean that I am getting node of type ELEMENT_NODE when
really I want type TEXT_NODE. Ok, well, I am parsing an xml like:
<XmlConfiguration>
  <Url>url configuration</Url>
</XmlConfiguration>
and trying to get the "url configuration" string.

But I am not using any schema hence no validation since I just wanted to
have a simple XML configuration file with minimum overheads.

Was this a bad idea?
How can I force the node to be a TEXT_NODE?

Martin.

Martin Bosticky
Software Engineer
Action Information Management Ltd.
Tel: (01225) 711200
Fax: (01225) 711222
Email: [EMAIL PROTECTED]


-----Original Message-----
From: Gareth Reakes [mailto:gareth@;decisionsoft.com] 
Sent: 24 October 2002 10:11
To: [EMAIL PROTECTED]
Subject: Re: getNodeValue() doesn't work?

Hi,
        the behaviour you are seeing is correct. Look at the docs for 
DOMNode where the return value for each of the node types is shown.

Gareth


On Thu, 24 Oct 2002, Martin Bosticky wrote:

> Hello. The way I apply my code means that getNodeValue() on DOMElement
> does not work correctly!
>  
> I have just joined the mailing group and done some search in bugzilla
to
> see if this is a known bug or what is going on?
>  
> I am using xercesc 2.1.0 in C++ and the code and my XML are very
> trivial:
>  
> Alfter parsing the document I get the top element and from that an
> element that I am interested in:
>  
> DOMNodeList* node 
> docElement->getElementsByTagName(XMLString::transcode("Url"));
>                                     DOMNode* el = (node->item(0));
>                                     std::string vl_Child1_str 
> CreateString(el->getNodeName());
>                                     std::string vl_Url_str 
> CreateString(el->getNodeValue());
>  
> The node 'el' that I obtain has the correct node name and so I try to
> get the node value which should be text. But getNodeValue() returns a
> null pointer.
>  
> **********************************************************
> I checked the source code and discovered that it seems like the
> DOMNodeImpl class has the function as a virtual function but the
derived
> object DOMElementImpl never overrides this so you will always get a
null
> pointer no matter what.
> **********************************************************
>  
> I have tested my XML by putting the desired url string into an
attribute
> and then I can easily retrieve it using getAttributes() etc.
>  
> Bugzilla didn't turn up anything that was up to date. Is this problem
> known?
> Should I do parsing another way that would work?
> Is version 2.1.0 full of bugs and I should not be using it?
> What to do?
>  
> Any comments would be appreciated, Martin.
>  
> Martin Bosticky
> Software Engineer
> Action Information Management Ltd.
> Tel: (01225) 711200
> Fax: (01225) 711222
> Email: [EMAIL PROTECTED]
>  
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



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



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

Reply via email to