Apparent bug when setting @xml:base on element with @base

Friday, 7 July 2023 · 2 messages
EK
Eliot Kimber7 Jul 2023 00:48 #
This XQuery demonstrates the problem:
(:--------:)
let $xmlBaseAtt as attribute() := attribute {'xml:base'}{'/foo/bar.xml'}
let $transformed1 as element() :=
try {
  $doc1 transform with { insert node $xmlBaseAtt into .}
} catch * {
  <error code="{$err:code}" desc="{$err:description}" object="doc1"/>
}

let $transformed2 as element() :=
try {
  $doc2 transform with { insert node $xmlBaseAtt into .}
} catch * {
  <error code="{$err:code}" desc="{$err:description}" object="doc2"/>
}

return (
  ``[No @base attribute:]``
  ,$transformed1
  ,``[Has @base attribute:]``
  ,$transformed2
  ,()
)
(:--------:)
The results I get with 10.6 are: No @base attribute: <root xml:base="/foo/bar.xml"/> Has @base attribute: <error code="err:XUDY0021" desc="Duplicate attribute name: xml:base." object="doc2"/> It looks like the transform processor is matching @xml:base to @base even though they are different attributes. Is this a bug or is there a different way I should be specifying the @xml:base attribute? This is an issue because @base is a DITA-defined attribute that occurs on elements on which I need to set @xml:base (which is how I found the problem). Cheers, Eliot _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
CG
Christian Grün7 Jul 2023 10:06 #
Hi Eliot, Thanks for the observation, a bug fix is available [1,2]. Best, Christian [1] https://files.basex.org/releases/latest/ [2] https://github.com/BaseXdb/basex/issues/2227
Quoted text · Eliot Kimber · 105 lines
On Fri, Jul 7, 2023 at 12:48 AM Eliot Kimber <eliot.kimber at servicenow.com> wrote: > > This XQuery demonstrates the problem: > > (:--------:) > let $xmlBaseAtt as attribute() := attribute {'xml:base'}{'/foo/bar.xml'} > > let $transformed1 as element() := > > try { > > $doc1 transform with { insert node $xmlBaseAtt into .} > > } catch * { > > <error code="{$err:code}" desc="{$err:description}" object="doc1"/> > > } > > > > let $transformed2 as element() := > > try { > > $doc2 transform with { insert node $xmlBaseAtt into .} > > } catch * { > > <error code="{$err:code}" desc="{$err:description}" object="doc2"/> > > } > > > > return ( > > ``[No @base attribute:]`` > > ,$transformed1 > > ,``[Has @base attribute:]`` > > ,$transformed2 > > ,() > > ) > > (:--------:) > > The results I get with 10.6 are: > > > > No @base attribute: > > <root xml:base="/foo/bar.xml"/> > > Has @base attribute: > > <error code="err:XUDY0021" desc="Duplicate attribute name: xml:base." object="doc2"/> > > > > It looks like the transform processor is matching @xml:base to @base even though they are different attributes. > > > > Is this a bug or is there a different way I should be specifying the @xml:base attribute? > > > > This is an issue because @base is a DITA-defined attribute that occurs on elements on which I need to set @xml:base (which is how I found the problem). > > > > Cheers, > > > > Eliot > > > > > > > > > > _____________________________________________ > > Eliot Kimber > > Sr Staff Content Engineer > > O: 512 554 9368 > > M: 512 554 9368 > > servicenow.com > > LinkedIn | Twitter | YouTube | Facebook

⚡Generated with XQuery