You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jean-Christophe Pazzaglia <Je...@eurecom.fr> on 2005/11/28 20:30:06 UTC
Select path typing behavior ?
Hi,
I do have a problem casting a selctPath to its proper type
(cannot cast XMLAnyTypeImpl to SignatureTemplateType)
while using :
SignatureTemplateType c=(SignatureTemplateType)
documentToSign.selectPath("declare namespace
msig='http://www.eurecom.fr/security/msig#';" +
"$this//msig:SignatureTemplate[@name='ID000004']")[0]
Further investigating I tried that :
documentToSign.selectPath("declare namespace
msig='http://www.eurecom.fr/security/msig#';" +
"$this//msig:SignatureTemplate[@name='ID000004']")
=>
[<xml-fragment name="ID000004"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:msig="http://www.eurecom.fr/security/msig#">
<!-- Valid SignatureTemplateType children .. -->
</xml-fragment> ]
documentToSign.selectPath("declare namespace
msig='http://www.eurecom.fr/security/msig#';" +
"$this//msig:SignatureTemplate[@name='ID000004']/..")
=>result
[<xml-fragment xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:msig="http://www.eurecom.fr/security/msig#">
<msig:SignatureTemplate name="ID000004">
<!-- Valid SignatureTemplateType children .. -->
]
I tried also that without success :
SignatureTemplateType c=(SignatureTemplateType)
documentToSign.selectPath("declare namespace
msig='http://www.eurecom.fr/security/msig#';" +
"$this//msig:SignatureTemplate[@name='"+signatureTemplateReference+"']")[0].changeType(SignatureTemplateType.type);
NB: the result of change type is the original object and not null ...
any clues ?
jc
PS: I am using the release 2.1
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org