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 ....
Dear John,
Isn't it normal behaviour ? I think attributes and namespaces cannot be serialized on themselves.
Best regards, Fabrice
De : basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] De la part de John Best Envoyé : mercredi 2 avril 2014 09:09 À : basex-talk@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
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/
John Best johnbest5673@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 ....
[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()
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@gmail.comwrote:
[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()
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@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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
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@gmail.comwrote:
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@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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de