|
Re: Retrieving user information [message #45319 is a reply to message #45221] |
Tue, 25 May 2004 10:32 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Dennis,
According to the Javadoc, Element.getNodeValue will always give you null. I
think you want to access the children, i.e., getFirstChild followed by
getNextSibling, which will yield the text nodes and other child nodes.
Dennis Fuglsang wrote:
> Ed,
>
> I am trying to retrieve the content of <xs:documentation> nodes in my XSD
> document. The logic I am trying is shown below but it does not return the
> content. I am unsure if Element.getNodeValue() is really the correct method
> to retrieve the content of the document node but I do not see any other
> methods via the Element API. Also, examining all the Annotation contents
> while running my code in debug has not given me any ideas. Do you have any
> suggestions?
> XSDAnnotation annotation = entity.getAnnotation();
> if(annotation != null){
> final Iterator userInfos =
> annotation.getUserInformation().iterator();
> while(userInfos.hasNext() ){
> final Element userInfo = (Element)userInfos.next();
> final String value = userInfo.getNodeValue();
> if (value != null) {
> return value;
> }
> }
> }
>
> Thanks in advance,
> Dennis Fuglsang
|
|
|
|
Re: Retrieving user information [message #587428 is a reply to message #45221] |
Tue, 25 May 2004 10:32 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Dennis,
According to the Javadoc, Element.getNodeValue will always give you null. I
think you want to access the children, i.e., getFirstChild followed by
getNextSibling, which will yield the text nodes and other child nodes.
Dennis Fuglsang wrote:
> Ed,
>
> I am trying to retrieve the content of <xs:documentation> nodes in my XSD
> document. The logic I am trying is shown below but it does not return the
> content. I am unsure if Element.getNodeValue() is really the correct method
> to retrieve the content of the document node but I do not see any other
> methods via the Element API. Also, examining all the Annotation contents
> while running my code in debug has not given me any ideas. Do you have any
> suggestions?
> XSDAnnotation annotation = entity.getAnnotation();
> if(annotation != null){
> final Iterator userInfos =
> annotation.getUserInformation().iterator();
> while(userInfos.hasNext() ){
> final Element userInfo = (Element)userInfos.next();
> final String value = userInfo.getNodeValue();
> if (value != null) {
> return value;
> }
> }
> }
>
> Thanks in advance,
> Dennis Fuglsang
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03798 seconds