[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-security-dev
Subject:    Re: Another interesting problem
From:       Christian Geuer-Pollmann <geuer-pollmann () nue ! et-inf ! uni-siegen ! de>
Date:       2001-10-12 14:32:51
[Download RAW message or body]

Hi Peter,

found the solution:

<prof:XPath>
count(
 ancestor-or-self::prof:Object
 |
 here()/ancestor::prof:Signature[1]/child::prof:Object[@Id='object-1']
) &lt;= count(
 ancestor-or-self::prof:Object
)
</prof:XPath>


String xpath = "count(ancestor-or-self::prof:Object | " +
"here()/ancestor::prof:Signature[1]/child::prof:Object[@Id='object-1']) <= 
count(ancestor-or-" + "self::prof:Object) ";

Christian



> --On Mittwoch, 10. Oktober 2001 17:00 +0200 Peter Tornberg
> <tberg@x-obi.com> wrote:
>
>> I've come across an interesting problem.
>>
>> When using an XPath of type:
>> ancestor-or-self::node() = here()/../../../../../ds:Object[1]
>>
>> If an object looks like below before the XPath operation:
>> <ds:Object>
>>     <tmp:Kaka xmlns:tmp="..." foo="bar">
>>          <apa>...</apa>
>>     </tmp:Kaka>
>> </ds:Object>
>>
>> it will look like below after the XPath operation:
>>
>> <ds:Object>
>>     <tmp:Kaka xmlns:tmp="...">
>>          <apa>...</apa>
>>     </tmp:Kaka>
>> </ds:Object>
>>
>> This is because as specified in the XPath spec section 5.3:
>>
>> Each element node has an associated set of attribute nodes; the element
>> is the parent of each of these attribute nodes; however, an attribute
>> node is not a child of its parent element.  The attribute has no parent
>> and thus is not included in the resulting node-set. This means that one
>> has to write some messy XPath to include the attributes as well, right?
>> Is there some workaround?
>> I think I want my attributes signed, don't you ;-)?

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic