Hm...could you send a small repro (query, instance and schema) so I can
take a look? It is odd that you need to use changeType to begin with as
selectPath should return the original object in your instance which
should already have the correct type. This issue aside, changeType will
not work if the type you're changing to is not a document type. (I have
a suspicion you're using a well known schema but can't find the
definition of SignatureTemplate)

--Yana

-----Original Message-----
From: Jean-Christophe Pazzaglia
[mailto:[EMAIL PROTECTED] 
Sent: Monday, November 28, 2005 11:30 AM
To: [EMAIL PROTECTED]
Subject: 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:[EMAIL PROTECTED]'ID000004']")[0]

Further investigating I tried that :

documentToSign.selectPath("declare namespace
msig='http://www.eurecom.fr/security/msig#';" +
                                   
"$this//msig:[EMAIL PROTECTED]'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:[EMAIL PROTECTED]'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:[EMAIL PROTECTED]'"+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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to