<p> While these abbreviations are quite handy, they demand some care when used in record patterns. As we said, the general form of a record pattern is:
...
...
@@ -148,9 +148,9 @@ As an example to summarize what we said above, consider the the elements
transitional XHTML these elements can have an attribute <code>bgcolor</code>
which is deprecated since in strict XHTML the background color must be specified
by the <code>style</code> attribute. So for instance <code><table
@@ -390,7 +396,7 @@ If one wants to write more explicitly:
</p>
<sample><![CDATA[
select <book (a)> x
from <book(a)>[ (x::(<(_\`editor)>_)|_ )* ] in bib
from <book(a)>[ (x::(<(_\`editor) ..>_)|_ )* ] in bib
]]>
</sample>
<p>Back to the first one:</p>
...
...
@@ -402,12 +408,13 @@ If one wants to write more explicitly:
</sample>
<p>
This query takes any element in bib, tranforms it in a book element and
removes sub-elements editor (but you will get a warning as capture variable book in the from is never used.
removes sub-elements editor, but you will get a warning as capture variable <code>book</code> in the <code>from</code> is never used: we should have written <code><(_) (a)></code> instead of <code><(book) (a)></code>
the from
</p>
<sample><![CDATA[
select <(book) (a)> x
from <(book) (a)>[ (x::(Any\Editor)|_ )* ] in bib
]]
]]>
</sample>
<p> Same thing but without tranforming tag to "book".
More interestingly:</p>
...
...
@@ -424,13 +431,13 @@ More interestingly:</p>
from <(b) (a)>[ (x::(Any\Editor)|_ )* ] in bib
]]>
</sample>
<p>Changes attribute id=x into bing=x
However, one must be shure that each element in bib has an "id" attribute
if such is not the case the expression is ill-typed. If one wants to perform this only for those elements which certainly have an "id" attribute then:
<p>Changes attribute <code>id=x</code> into <code>bing=x</code>
However, one must be sure that each element in <code>bib</code> has an <code>id</code> attribute
if such is not the case the expression is ill-typed. If one wants to perform this only for those elements which certainly have an <code>id</code> attribute then:
</p>
<sample><![CDATA[
select <(b) (a\id+{bing=a.id})> x
from <(b) (a&{id=_}))>[ (x::(Any\Editor)|_ )* ] in bib
from <(b) (a&{id=_ ..}))>[ (x::(Any\Editor)|_ )* ] in bib