You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Marcelo de Barros Alcantara <ca...@uolinc.com> on 2007/09/19 19:53:21 UTC

JXPath //

Hi All,
 
I have a Bean structure created and marshalled/unmarshalled by JAXB.
 
I am trying to use the "//" syntax to get all "content-options" objects
at all levels inside the structure. But it is not working. It always
return null or exception.
 
My structure is like that:
 
Module
+-Group
     +-Field
            +-Content-Options
 
What is interesting is that, if I do context.getValue("//field") I get
all field objects from the 1st group only. At least it returns
something. But for Content-Options it never works.
 
Somebody can give me a hand with that?
 
Thanks in advance!!!
 
Marcelo Alcantara
maralc@gmail.com


AVISO: A informacao contida neste e-mail, bem como em qualquer de seus anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s) destinatario(s) acima referido(s), podendo conter informacoes sigilosas e/ou legalmente protegidas. Caso voce nao seja o destinatario desta mensagem, informamos que qualquer divulgacao, distribuicao ou copia deste e-mail e/ou de qualquer de seus anexos e absolutamente proibida. Solicitamos que o remetente seja comunicado imediatamente, respondendo esta mensagem, e que o original desta mensagem e de seus anexos, bem como toda e qualquer copia e/ou impressao realizada a partir destes, sejam permanentemente apagados e/ou destruidos. Informacoes adicionais sobre nossa empresa podem ser obtidas no site http://sobre.uol.com.br/.

NOTICE: The information contained in this e-mail and any attachments thereto is CONFIDENTIAL and is intended only for use by the recipient named herein and may contain legally privileged and/or secret information. If you are not the e-mail?s intended recipient, you are hereby notified that any dissemination, distribution or copy of this e-mail, and/or any attachments thereto, is strictly prohibited. Please immediately notify the sender replying to the above mentioned e-mail address, and permanently delete and/or destroy the original and any copy of this e-mail and/or its attachments, as well as any printout thereof. Additional information about our company may be obtained through the site http://www.uol.com.br/ir/.

RE: JXPath //

Posted by Marcelo de Barros Alcantara <ca...@uolinc.com>.
Hi Alessandrro,

Thanks for your attention.

My XML looks like closer to this:

<Module id="module1">
	<Group id="group1">
  		<Field id="field1">
			<Content-Options id="contentOptions1">
		</Field>
	</Group>
</Module>
<Module id="module2">
	<Group id="group1">
  		<Field id="field1">
			<Content-Options id="contentOptions1">
		</Field>
	</Group>
</Module>


What I wanted, was, with the //contentOptions, return all
<Content-Options> objects in all levels of the XML object.

I tried different combinations of //contentOptions. All without success.

Using "//field" for testing, It returned all existing field objects just
from the first module/group combination (<Module id="module1">/<Group
id="group1">). Shouldn't it return all the field objects from the whole
XML?

thanks, Marcelo


-----Original Message-----
From: Alessandro Ferrucci [mailto:alessandroferrucci@gmail.com] 
Sent: sexta-feira, 21 de setembro de 2007 08:02
To: Jakarta Commons Users List
Subject: Re: JXPath //

Not sure if this is what you're looking for but try:

//* (will give you everything)

or

//Field (this will give you only all values of 'Field' element... again,
not sure what you want exactly, please give more detailed XML snippet
and then we can get more detailed answer :)

hope that gets you closer to your answer.

alessandro ferrucci :)

On 9/20/07, Marcelo de Barros Alcantara <ca...@uolinc.com>
wrote:
>
> Somebody can help?
>
> Thanks!
>
> -----Original Message-----
> From: Marcelo de Barros Alcantara [mailto:cad_malcantara@uolinc.com]
> Sent: quarta-feira, 19 de setembro de 2007 14:53
> To: user@commons.apache.org
> Subject: JXPath //
> Importance: High
>
> Hi All,
>
> I have a Bean structure created and marshalled/unmarshalled by JAXB.
>
> I am trying to use the "//" syntax to get all "content-options" 
> objects at all levels inside the structure. But it is not working. It 
> always return null or exception.
>
> My structure is like that:
>
> Module
> +-Group
>      +-Field
>             +-Content-Options
>
> What is interesting is that, if I do context.getValue("//field") I get

> all field objects from the 1st group only. At least it returns 
> something. But for Content-Options it never works.
>
> Somebody can give me a hand with that?
>
> Thanks in advance!!!
>
> Marcelo Alcantara
> maralc@gmail.com
>
>
> AVISO: A informacao contida neste e-mail, bem como em qualquer de seus

> anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s)
> destinatario(s) acima referido(s), podendo conter informacoes 
> sigilosas e/ou legalmente protegidas. Caso voce nao seja o 
> destinatario desta mensagem, informamos que qualquer divulgacao, 
> distribuicao ou copia deste e-mail e/ou de qualquer de seus anexos e
absolutamente proibida.
> Solicitamos que o remetente seja comunicado imediatamente, respondendo

> esta mensagem, e que o original desta mensagem e de seus anexos, bem 
> como toda e qualquer copia e/ou impressao realizada a partir destes, 
> sejam permanentemente apagados e/ou destruidos. Informacoes adicionais

> sobre nossa empresa podem ser obtidas no site
http://sobre.uol.com.br/.
>
> NOTICE: The information contained in this e-mail and any attachments 
> thereto is CONFIDENTIAL and is intended only for use by the recipient 
> named herein and may contain legally privileged and/or secret 
> information. If you are not the e-mail?s intended recipient, you are 
> hereby notified that any dissemination, distribution or copy of this 
> e-mail, and/or any attachments thereto, is strictly prohibited. Please

> immediately notify the sender replying to the above mentioned e-mail 
> address, and permanently delete and/or destroy the original and any 
> copy of this e-mail and/or its attachments, as well as any printout
thereof.
> Additional information about our company may be obtained through the 
> site http://www.uol.com.br/ir/.
>
>
> AVISO: A informacao contida neste e-mail, bem como em qualquer de seus

> anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s) 
> destinatario(s) acima referido(s), podendo conter informacoes 
> sigilosas e/ou legalmente protegidas. Caso voce nao seja o 
> destinatario desta mensagem, informamos que qualquer divulgacao, 
> distribuicao ou copia deste e-mail e/ou de qualquer de seus anexos e 
> absolutamente proibida. Solicitamos que o remetente seja comunicado 
> imediatamente, respondendo esta mensagem, e que o original desta 
> mensagem e de seus anexos, bem como toda e qualquer copia e/ou
impressao realizada a partir destes, sejam permanentemente apagados e/ou
destruidos.
> Informacoes adicionais sobre nossa empresa podem ser obtidas no site 
> http://sobre.uol.com.br/.
>
> NOTICE: The information contained in this e-mail and any attachments 
> thereto is CONFIDENTIAL and is intended only for use by the recipient 
> named herein and may contain legally privileged and/or secret 
> information. If you are not the e-mail?s intended recipient, you are 
> hereby notified that any dissemination, distribution or copy of this 
> e-mail, and/or any attachments thereto, is strictly prohibited. Please

> immediately notify the sender replying to the above mentioned e-mail 
> address, and permanently delete and/or destroy the original and any 
> copy of this e-mail and/or its attachments, as well as any printout 
> thereof. Additional information about our company may be obtained
through the site http://www.uol.com.br/ir/.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>


AVISO: A informacao contida neste e-mail, bem como em qualquer de seus anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s) destinatario(s) acima referido(s), podendo conter informacoes sigilosas e/ou legalmente protegidas. Caso voce nao seja o destinatario desta mensagem, informamos que qualquer divulgacao, distribuicao ou copia deste e-mail e/ou de qualquer de seus anexos e absolutamente proibida. Solicitamos que o remetente seja comunicado imediatamente, respondendo esta mensagem, e que o original desta mensagem e de seus anexos, bem como toda e qualquer copia e/ou impressao realizada a partir destes, sejam permanentemente apagados e/ou destruidos. Informacoes adicionais sobre nossa empresa podem ser obtidas no site http://sobre.uol.com.br/.

NOTICE: The information contained in this e-mail and any attachments thereto is CONFIDENTIAL and is intended only for use by the recipient named herein and may contain legally privileged and/or secret information. If you are not the e-mail?s intended recipient, you are hereby notified that any dissemination, distribution or copy of this e-mail, and/or any attachments thereto, is strictly prohibited. Please immediately notify the sender replying to the above mentioned e-mail address, and permanently delete and/or destroy the original and any copy of this e-mail and/or its attachments, as well as any printout thereof. Additional information about our company may be obtained through the site http://www.uol.com.br/ir/.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: JXPath //

Posted by Alessandro Ferrucci <al...@gmail.com>.
Not sure if this is what you're looking for but try:

//* (will give you everything)

or

//Field (this will give you only all values of 'Field' element... again, not
sure what you want exactly, please give more detailed XML snippet and then
we can get more detailed answer :)

hope that gets you closer to your answer.

alessandro ferrucci :)

On 9/20/07, Marcelo de Barros Alcantara <ca...@uolinc.com> wrote:
>
> Somebody can help?
>
> Thanks!
>
> -----Original Message-----
> From: Marcelo de Barros Alcantara [mailto:cad_malcantara@uolinc.com]
> Sent: quarta-feira, 19 de setembro de 2007 14:53
> To: user@commons.apache.org
> Subject: JXPath //
> Importance: High
>
> Hi All,
>
> I have a Bean structure created and marshalled/unmarshalled by JAXB.
>
> I am trying to use the "//" syntax to get all "content-options" objects
> at all levels inside the structure. But it is not working. It always
> return null or exception.
>
> My structure is like that:
>
> Module
> +-Group
>      +-Field
>             +-Content-Options
>
> What is interesting is that, if I do context.getValue("//field") I get
> all field objects from the 1st group only. At least it returns
> something. But for Content-Options it never works.
>
> Somebody can give me a hand with that?
>
> Thanks in advance!!!
>
> Marcelo Alcantara
> maralc@gmail.com
>
>
> AVISO: A informacao contida neste e-mail, bem como em qualquer de seus
> anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s)
> destinatario(s) acima referido(s), podendo conter informacoes sigilosas
> e/ou legalmente protegidas. Caso voce nao seja o destinatario desta
> mensagem, informamos que qualquer divulgacao, distribuicao ou copia
> deste e-mail e/ou de qualquer de seus anexos e absolutamente proibida.
> Solicitamos que o remetente seja comunicado imediatamente, respondendo
> esta mensagem, e que o original desta mensagem e de seus anexos, bem
> como toda e qualquer copia e/ou impressao realizada a partir destes,
> sejam permanentemente apagados e/ou destruidos. Informacoes adicionais
> sobre nossa empresa podem ser obtidas no site http://sobre.uol.com.br/.
>
> NOTICE: The information contained in this e-mail and any attachments
> thereto is CONFIDENTIAL and is intended only for use by the recipient
> named herein and may contain legally privileged and/or secret
> information. If you are not the e-mail?s intended recipient, you are
> hereby notified that any dissemination, distribution or copy of this
> e-mail, and/or any attachments thereto, is strictly prohibited. Please
> immediately notify the sender replying to the above mentioned e-mail
> address, and permanently delete and/or destroy the original and any copy
> of this e-mail and/or its attachments, as well as any printout thereof.
> Additional information about our company may be obtained through the
> site http://www.uol.com.br/ir/.
>
>
> AVISO: A informacao contida neste e-mail, bem como em qualquer de seus
> anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s) destinatario(s)
> acima referido(s), podendo conter informacoes sigilosas e/ou legalmente
> protegidas. Caso voce nao seja o destinatario desta mensagem, informamos que
> qualquer divulgacao, distribuicao ou copia deste e-mail e/ou de qualquer de
> seus anexos e absolutamente proibida. Solicitamos que o remetente seja
> comunicado imediatamente, respondendo esta mensagem, e que o original desta
> mensagem e de seus anexos, bem como toda e qualquer copia e/ou impressao
> realizada a partir destes, sejam permanentemente apagados e/ou destruidos.
> Informacoes adicionais sobre nossa empresa podem ser obtidas no site
> http://sobre.uol.com.br/.
>
> NOTICE: The information contained in this e-mail and any attachments
> thereto is CONFIDENTIAL and is intended only for use by the recipient named
> herein and may contain legally privileged and/or secret information. If you
> are not the e-mail?s intended recipient, you are hereby notified that any
> dissemination, distribution or copy of this e-mail, and/or any attachments
> thereto, is strictly prohibited. Please immediately notify the sender
> replying to the above mentioned e-mail address, and permanently delete
> and/or destroy the original and any copy of this e-mail and/or its
> attachments, as well as any printout thereof. Additional information about
> our company may be obtained through the site http://www.uol.com.br/ir/.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

RE: JXPath //

Posted by Marcelo de Barros Alcantara <ca...@uolinc.com>.
Somebody can help?

Thanks! 

-----Original Message-----
From: Marcelo de Barros Alcantara [mailto:cad_malcantara@uolinc.com] 
Sent: quarta-feira, 19 de setembro de 2007 14:53
To: user@commons.apache.org
Subject: JXPath //
Importance: High

Hi All,
 
I have a Bean structure created and marshalled/unmarshalled by JAXB.
 
I am trying to use the "//" syntax to get all "content-options" objects
at all levels inside the structure. But it is not working. It always
return null or exception.
 
My structure is like that:
 
Module
+-Group
     +-Field
            +-Content-Options
 
What is interesting is that, if I do context.getValue("//field") I get
all field objects from the 1st group only. At least it returns
something. But for Content-Options it never works.
 
Somebody can give me a hand with that?
 
Thanks in advance!!!
 
Marcelo Alcantara
maralc@gmail.com


AVISO: A informacao contida neste e-mail, bem como em qualquer de seus
anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s)
destinatario(s) acima referido(s), podendo conter informacoes sigilosas
e/ou legalmente protegidas. Caso voce nao seja o destinatario desta
mensagem, informamos que qualquer divulgacao, distribuicao ou copia
deste e-mail e/ou de qualquer de seus anexos e absolutamente proibida.
Solicitamos que o remetente seja comunicado imediatamente, respondendo
esta mensagem, e que o original desta mensagem e de seus anexos, bem
como toda e qualquer copia e/ou impressao realizada a partir destes,
sejam permanentemente apagados e/ou destruidos. Informacoes adicionais
sobre nossa empresa podem ser obtidas no site http://sobre.uol.com.br/.

NOTICE: The information contained in this e-mail and any attachments
thereto is CONFIDENTIAL and is intended only for use by the recipient
named herein and may contain legally privileged and/or secret
information. If you are not the e-mail?s intended recipient, you are
hereby notified that any dissemination, distribution or copy of this
e-mail, and/or any attachments thereto, is strictly prohibited. Please
immediately notify the sender replying to the above mentioned e-mail
address, and permanently delete and/or destroy the original and any copy
of this e-mail and/or its attachments, as well as any printout thereof.
Additional information about our company may be obtained through the
site http://www.uol.com.br/ir/.


AVISO: A informacao contida neste e-mail, bem como em qualquer de seus anexos, e CONFIDENCIAL e destinada ao uso exclusivo do(s) destinatario(s) acima referido(s), podendo conter informacoes sigilosas e/ou legalmente protegidas. Caso voce nao seja o destinatario desta mensagem, informamos que qualquer divulgacao, distribuicao ou copia deste e-mail e/ou de qualquer de seus anexos e absolutamente proibida. Solicitamos que o remetente seja comunicado imediatamente, respondendo esta mensagem, e que o original desta mensagem e de seus anexos, bem como toda e qualquer copia e/ou impressao realizada a partir destes, sejam permanentemente apagados e/ou destruidos. Informacoes adicionais sobre nossa empresa podem ser obtidas no site http://sobre.uol.com.br/.

NOTICE: The information contained in this e-mail and any attachments thereto is CONFIDENTIAL and is intended only for use by the recipient named herein and may contain legally privileged and/or secret information. If you are not the e-mail?s intended recipient, you are hereby notified that any dissemination, distribution or copy of this e-mail, and/or any attachments thereto, is strictly prohibited. Please immediately notify the sender replying to the above mentioned e-mail address, and permanently delete and/or destroy the original and any copy of this e-mail and/or its attachments, as well as any printout thereof. Additional information about our company may be obtained through the site http://www.uol.com.br/ir/.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org