Hi, Enric.

Enric Jaen <[EMAIL PROTECTED]> wrote on 2006-01-18 06:23:12 AM:
> Is there any way to filter the child elements of a given Xpath 
> expression? (without using multiple paths)
> 
> For example, having this:
> 
> <AAA>
>   <BBB/>
>   <CCC/>
>   <DDD/>
> </AAA>
> 
> I'd like to return AAA with only BBB and CCC elements

     If I understand correctly, you want a single XPath expression that 
will return the element AAA with its child element DDD "hidden."  Did I 
understand you correctly?  That can't be done in XPath - if the AAA node 
is returned by an expression, you have access to all its children.

     Perhaps an XMLFilter would satisfy your requirement.  See [1] for 
more information.

Thanks,

Henry
[1] http://xml.apache.org/xalan-j/apidocs/org/xml/sax/XMLFilter.html
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]

Reply via email to