Hi. I am trying to understand the way XPath words. I have a valid digital signature in dsig format and trying to analyze it. There is this expression:
<Reference URI="metadata/signableMetadata0.xml" xmlns="- <Transforms xmlns="- <Transform Algorithm=" <XPath>ancestor-or-self::*[@ID='signature_0']</XPath>
</Transform>
<Transform Algorithm=" />
</Transforms>
<DigestMethod Algorithm=" />
<DigestValue>XIrOvoOM33rWvV5Fdckax/bNLOpR9RNIonkVQ22fczM=</DigestValue>
</Reference>
So from what I understand, the XPath expression ancestor-or-self::*[@ID='signature_0'] links to a specific position ('signature_0') in file metadata/signableMetadata0.xml (it's attached). In other words, it should return a block of code that falls under that ID from the file. But there is a problem:
I have tried several online XPath testing tools, and the XPath expression doesn't seem to return anything. That is so weird. I don't understand it, as the that expression was written by a digital signature software - it can't be wrong, because I took it from an xml file from a valid digital signature. Any ideas as to why it doesn't return anything on these tools? , ,
<Reference URI="metadata/signableMetadata0.xml" xmlns="- <Transforms xmlns="- <Transform Algorithm=" <XPath>ancestor-or-self::*[@ID='signature_0']</XPath>
</Transform>
<Transform Algorithm=" />
</Transforms>
<DigestMethod Algorithm=" />
<DigestValue>XIrOvoOM33rWvV5Fdckax/bNLOpR9RNIonkVQ22fczM=</DigestValue>
</Reference>
So from what I understand, the XPath expression ancestor-or-self::*[@ID='signature_0'] links to a specific position ('signature_0') in file metadata/signableMetadata0.xml (it's attached). In other words, it should return a block of code that falls under that ID from the file. But there is a problem:
I have tried several online XPath testing tools, and the XPath expression doesn't seem to return anything. That is so weird. I don't understand it, as the that expression was written by a digital signature software - it can't be wrong, because I took it from an xml file from a valid digital signature. Any ideas as to why it doesn't return anything on these tools? , ,