bungeni-org / bungeni-editor

The Bungeni Editor is Drafting and Markup framework for XML production built on the OpenOffice.org platform. It supports different legislative document types (e.g hansard, bill) and supports definition of custom types, and allows markup and storage of metadata within the ODF document.
3 stars 0 forks source link

eXistQueryUI - XSLT transform problem #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.eXistQueryUI searches the xml db for speeches matching a particular MP
2.matched speeches are returned in a XML envelope
3.the envelope is transformed to html to output the results

What is the expected output? What do you see instead?
Output results for the same XML envelope and XSLT differ when run within
eXist and when run on the client using Oxygen.

Original issue reported on code.google.com by ashok.ha...@gmail.com on 27 Jan 2010 at 10:20

GoogleCodeExporter commented 9 years ago
Oxygen uses a schema aware version of Saxon -- the XML search result envelope
packages AkomaNtoso speeches in the AKomaNtoso namespace while the rest of the
elements of the envelope are in the default namespace. This works in Saxon 
because of
the schema aware XSLT processor.

The same version of Saxon in eXist is the non-schema aware processor - hence 
this
drops all the elements which are not in the default namespace and hence 
speeches are
never matched.

The XML envelope needs to be stripped of any namespace info before being 
transformed -- 

declare function local:strip-namespace($e as element()) as element() {

   element {QName((),local-name($e))} {
    for $child in $e/(@*,node())
    return
      if ($child instance of element())
      then
        local:strip-namespace($child)
      else
        $child
  }
};

the above function scrubs all elements for any namespace information and 
removes it.
The XSLT works identically in both Oxygen and eXist.

Original comment by ashok.ha...@gmail.com on 27 Jan 2010 at 10:24