attribute string conversion problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

attribute string conversion problem

Craig-19
Hello,

i am trying to execute the following valid Xpath query using saxon, but i
keep getting "Required item type of second operand of '/' is node();
supplied value has item type xs:string"

//ns:Input[@id='oakIN_I1']/ns:Shifts/string(@idref)

this however works to a degree,

string(//ns:Input[@id=oakIN_I1]/nsShifts/@idref)

but the above query only returns the first attribute, and also should not
return because result should be a sequence i believe.

example xml

<Input id="oakIN_I1">
        <Shifts idref="oakSHFT_001">
            <MobDev>oakMOBDEVGP_1</MobDev>
            <FixDev>oakFIXDEVGP_1</FixDev>
        </Shifts>
        <Shifts idref="oakSHFT_002">
            <MobDev>oakMOBDEVGP_1</MobDev>
            <FixDev>oakFIXDEVGP_1</FixDev>
        </Shifts>
        <Shifts idref="oakSHFT_003">
            <MobDev>oakMOBDEVGP_1</MobDev>
            <FixDev>oakFIXDEVGP_1</FixDev>
        </Shifts>
    </Input>

Regards,
Craig Coley.







-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: attribute string conversion problem

Michael Kay
I suspect (judging from the error message) that you are using an old version
of the software. The current version is 8.6.1.


Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Craig
> Sent: 21 February 2006 08:43
> To: [hidden email]
> Subject: [saxon] attribute string conversion problem
>
> Hello,
>
> i am trying to execute the following valid Xpath query using
> saxon, but i
> keep getting "Required item type of second operand of '/' is node();
> supplied value has item type xs:string"
>
> //ns:Input[@id='oakIN_I1']/ns:Shifts/string(@idref)
>
> this however works to a degree,
>
> string(//ns:Input[@id=oakIN_I1]/nsShifts/@idref)
>
> but the above query only returns the first attribute, and
> also should not
> return because result should be a sequence i believe.
>
> example xml
>
> <Input id="oakIN_I1">
>         <Shifts idref="oakSHFT_001">
>             <MobDev>oakMOBDEVGP_1</MobDev>
>             <FixDev>oakFIXDEVGP_1</FixDev>
>         </Shifts>
>         <Shifts idref="oakSHFT_002">
>             <MobDev>oakMOBDEVGP_1</MobDev>
>             <FixDev>oakFIXDEVGP_1</FixDev>
>         </Shifts>
>         <Shifts idref="oakSHFT_003">
>             <MobDev>oakMOBDEVGP_1</MobDev>
>             <FixDev>oakFIXDEVGP_1</FixDev>
>         </Shifts>
>     </Input>
>
> Regards,
> Craig Coley.
>
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&
> dat=121642
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help