Attribute cannot be serialized !!

Wednesday, 2 April 2014 · 7 messages
JB
John Best2 Apr 2014 09:09 #
Dear Team, I have downloaded the latest source code of BaseX, by latest I mean just a half hour ago. When I run it through Eclipse, I am getting error - [SENR0001] Attributes cannot be serialized:db:open-pre("docdb",7). This comes when, I try to get ONLY attributes ....
-- Have a nice day JBest
FE
Fabrice Etanchaud2 Apr 2014 09:16 #
Dear John, Isn't it normal behaviour ? I think attributes and namespaces cannot be serialized on themselves. Best regards, Fabrice
Quoted text · John Best · 11 lines
De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de John Best Envoyé : mercredi 2 avril 2014 09:09 À : basex-talk at mailman.uni-konstanz.de Objet : [basex-talk] Attribute cannot be serialized !! Dear Team, I have downloaded the latest source code of BaseX, by latest I mean just a half hour ago. When I run it through Eclipse, I am getting error - [SENR0001] Attributes cannot be serialized:db:open-pre("docdb",7). This comes when, I try to get ONLY attributes .... -- Have a nice day JBest
HR
Hans-Juergen Rennauin reply to John Best, 2 Apr 2014, 09:092 Apr 2014 09:18 #
Hi John, that's correct - attributes cannot be serialized. It's not the fault of BaseX; the reason are intricacies of the serialization model [1]. (The attributes would become attributes of a document node, which is not possible.) Perhaps you can get avoid the problem by attaching to your query expression which yields the attributes /string(), like //a/@b/string()? Kind regards, Hans-Jürgen [1] http://www.w3.org/TR/xslt-xquery-serialization/
Quoted text · John Best · 1 line
John Best <johnbest5673 at gmail.com> schrieb am 9:09 Mittwoch, 2.April 2014:
Dear Team, I have downloaded the latest source code of BaseX, by latest I mean just a half hour ago. When I run it through Eclipse, I am getting error - [SENR0001] Attributes cannot be serialized:db:open-pre("docdb",7). This comes when, I try to get ONLY attributes ....
-- Have a nice day JBest _______________________________________________ BaseX-Talk mailing list BaseX-Talk at mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
CG
Christian Grünin reply to John Best, 2 Apr 2014, 09:092 Apr 2014 09:19 #
Quoted text · John Best · 1 line
> [SENR0001] Attributes cannot be serialized:db:open-pre("docdb",7).
This is in compliance with the spec, which prevents attributes from being serialized without their elements. A simple example that triggers the error:
  <a b="c"/>/@b
This is how you can request the attribute value:
  <a b="c"/>/@b/data()
This is how you can request its name:
  <a b="c"/>/@b/name()
JB
John Best2 Apr 2014 09:33 #
Dear Christian, Fabrice and Hans-Juergen, Thanks for your answers. In the earlier versions of BaseX, upto 7.6, the following query was running smoothly -
for $x in doc('docs')//Doc[Year="2014"]/@name
order by $x
return $x
So, in all of my code, I have used in same manner. But in 7.8.1 and onwards (after 7.6, I directly jumped to 7.8.1), this query results in error !!! So for this new versions, my above query will be -
for $x in doc('docs')//Doc[Year="2014"]/@name
order by $x
return $x/string() (: or $x/data() :)
But, then why the earlier versions where supporting the first query ? On Wed, Apr 2, 2014 at 12:49 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 16 lines
> > [SENR0001] Attributes cannot be serialized:db:open-pre("docdb",7). > > This is in compliance with the spec, which prevents attributes from > being serialized without their elements. A simple example that > triggers the error: > > <a b="c"/>/@b > > This is how you can request the attribute value: > > <a b="c"/>/@b/data() > > This is how you can request its name: > > <a b="c"/>/@b/name() >
-- Have a nice day JBest
CG
Christian Grün2 Apr 2014 09:37 #
We continuously improve the XQuery compliance ratio of BaseX. In the beginning, we considered the serialization of attributes helpful, but as it contradicted with the serialization spec., we eventually removed this exception and replaced it with the correct behavior. decided to make BaseX more conformant
Quoted text · John Best · 60 lines
> Thanks for your answers. > > In the earlier versions of BaseX, upto 7.6, the following query was running > smoothly - > > for $x in doc('docs')//Doc[Year="2014"]/@name > order by $x > return $x > > So, in all of my code, I have used in same manner. But in 7.8.1 and onwards > (after 7.6, I directly jumped to 7.8.1), > this query results in error !!! > > So for this new versions, my above query will be - > > for $x in doc('docs')//Doc[Year="2014"]/@name > order by $x > return $x/string() (: or $x/data() :) > > But, then why the earlier versions where supporting the first query ? > > > > > > > > On Wed, Apr 2, 2014 at 12:49 PM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> > [SENR0001] Attributes cannot be serialized:db:open-pre("docdb",7). >> >> This is in compliance with the spec, which prevents attributes from >> being serialized without their elements. A simple example that >> triggers the error: >> >> <a b="c"/>/@b >> >> This is how you can request the attribute value: >> >> <a b="c"/>/@b/data() >> >> This is how you can request its name: >> >> <a b="c"/>/@b/name() > > > > > -- > Have a nice day > JBest > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
JB
John Best2 Apr 2014 10:03 #
Dear Christian, That's great... Improvements are the part of life. I can proudly say that my decision of selecting BaseX as DB is excellent. Its growing features wise... I look forward that my required feature will also soon be added; Mixed Content ;) On Wed, Apr 2, 2014 at 1:07 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 72 lines
> We continuously improve the XQuery compliance ratio of BaseX. In the > beginning, we considered the serialization of attributes helpful, but > as it contradicted with the serialization spec., we eventually removed > this exception and replaced it with the correct behavior. > > > decided to make BaseX more conformant > > > Thanks for your answers. > > > > In the earlier versions of BaseX, upto 7.6, the following query was > running > > smoothly - > > > > for $x in doc('docs')//Doc[Year="2014"]/@name > > order by $x > > return $x > > > > So, in all of my code, I have used in same manner. But in 7.8.1 and > onwards > > (after 7.6, I directly jumped to 7.8.1), > > this query results in error !!! > > > > So for this new versions, my above query will be - > > > > for $x in doc('docs')//Doc[Year="2014"]/@name > > order by $x > > return $x/string() (: or $x/data() :) > > > > But, then why the earlier versions where supporting the first query ? > > > > > > > > > > > > > > > > On Wed, Apr 2, 2014 at 12:49 PM, Christian Grün < > christian.gruen at gmail.com> > > wrote: > >> > >> > [SENR0001] Attributes cannot be serialized:db:open-pre("docdb",7). > >> > >> This is in compliance with the spec, which prevents attributes from > >> being serialized without their elements. A simple example that > >> triggers the error: > >> > >> <a b="c"/>/@b > >> > >> This is how you can request the attribute value: > >> > >> <a b="c"/>/@b/data() > >> > >> This is how you can request its name: > >> > >> <a b="c"/>/@b/name() > > > > > > > > > > -- > > Have a nice day > > JBest > > > > > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > >
-- Have a nice day JBest

⚡Generated with XQuery