List Info

Thread: RE : How to get the info




RE : How to get the info
country flaguser name
France
2007-08-09 02:45:43

Hi,

 

That’;s what i have done :

 

XmlCursor cursor = textDescription.newCursor();

String text = cursor.getTextValue().trim();

cursor.dispose();

 

where textDescription is the <Description> node.

 

But in the variable “text” i am recupering: “Title text    How do I acces here ?? http://google.com&#8221;.

 

So, there is not an easy form to extract the text i want L

 

Do you know any other way to do it ??

 

Anyway, thanks for the answer.

 

 

Ezequiel.

 

 

-----Message d'origine-----
De : Vinh Nguyen (vinguye2) [mailto:vinguye2cisco.com]
Envoyé&nbsp;: mercredi 8 août 2007 20:56
À : devxmlbeans.apache.org
Objet ;: RE: How to get the info

 

I think using XmlCursor, you can call getTextValue() on the <Descriptions> node. ; This will basically get you all the text values that are dangling between this node's child nodes.

 


From: Ezequiel Puig [mailto:e.puizvivacances.fr]
Sent: Wednesday, August 08, 2007 8:15 AM
To: devxmlbeans.apache.org
Subject: How to get the info

Hi,

 

I am really new in XMLBeans, so probably this is an easy question:

 

I have the following piece of XML:

 

<Descriptions>

 &nbsp; &nbsp; &nbsp;  <Description Role=";Summary&quot;>

 &nbsp; &nbsp; &nbsp; &nbsp;  <Title>Title text</Title>

 &nbsp; &nbsp; &nbsp; &nbsp;  How do I acces here ??

 &nbsp; &nbsp; &nbsp; &nbsp;  <Media>

 &nbsp; &nbsp; &nbsp; &nbsp;   ; <URL&gt;http://www.google.com</URL&gt;

 &nbsp; &nbsp; &nbsp; &nbsp;  </Media>

 &nbsp; &nbsp; &nbsp;  </Description>

<Descriptions>

 

XMLBeans has created for me methods like getDescription(), gerRole, getTitle, getMedia, etc. But my prolem is that i don’t know how to get the piece of text “How do I acces here ??” ??

RE: RE : How to get the info
user name
2007-08-09 15:57:19

Method getTextValue() returns for a startElement the entire text of the subtree as it javadocs says.

The idea is to move the cursor to the right place and get it:

 

        if (!cursor.toNextToken().isNone())

        {

            do

            {

                System.out.println(&quot; c->; " + cursor.currentTokenType());

                if (cursor.isStart())

                    cursor.toEndToken();

                else if (cursor.isText())

                    System.out.println(&quot;Text " + cursor.getTextValue());

            }

            while(!cursor.toNextToken().isNone());

        }

 

Cezar

 


From: Ezequiel Puig [mailto:e.puizvivacances.fr]
Sent: Thursday, August 09, 2007 2:46 AM
To: devxmlbeans.apache.org
Subject: RE : How to get the info

 

Hi,

 

That’;s what i have done :

 

XmlCursor cursor = textDescription.newCursor();

String text = cursor.getTextValue().trim();

cursor.dispose();

 

where textDescription is the <Description> node.

 

But in the variable “text” i am recupering: “Title text   ; How do I acces here ?? http://google.com221;.

 

So, there is not an easy form to extract the text i want L

 

Do you know any other way to do it ??

 

Anyway, thanks for the answer.

 

 

Ezequiel.

 

 

-----Message d'origine-----
De : Vinh Nguyen (vinguye2) [mailto:vinguye2cisco.com]
Envoyé&nbsp;: mercredi 8 août 2007 20:56
À : devxmlbeans.apache.org
Objet ;: RE: How to get the info

 

I think using XmlCursor, you can call getTextValue() on the <Descriptions> node. ; This will basically get you all the text values that are dangling between this node's child nodes.

 


From: Ezequiel Puig [mailto:e.puizvivacances.fr]
Sent: Wednesday, August 08, 2007 8:15 AM
To: devxmlbeans.apache.org
Subject: How to get the info

Hi,

 

I am really new in XMLBeans, so probably this is an easy question:

 

I have the following piece of XML:

 

<Descriptions>

 &nbsp; &nbsp; &nbsp;  <Description Role=";Summary&quot;>

 &nbsp; &nbsp; &nbsp; &nbsp;  <Title>Title text</Title>

 &nbsp; &nbsp; &nbsp; &nbsp;  How do I acces here ??

 &nbsp; &nbsp; &nbsp; &nbsp;  <Media>

 &nbsp; &nbsp; &nbsp; &nbsp;   ; <URL&gt;http://www.google.com</URL&gt;

 &nbsp; &nbsp; &nbsp; &nbsp;  </Media>

 &nbsp; &nbsp; &nbsp;  </Description>

<Descriptions>

 

XMLBeans has created for me methods like getDescription(), gerRole, getTitle, getMedia, etc. But my prolem is that i donR17;t know how to get the piece of text “How do I acces here ??&#8221; ??

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )