|Subject: Xslt mapper: changing target schema from qualified to unqualified leaves the root element qualified|
Author: David Karr
Date: 09 Mar 2006 11:43 AM
I had two XSDs, I created a new XSLT mapper and set them as the source
and target. I started mapping elements, and then I ran a preview. I
noticed that the target elements were qualified, but I had wanted them
to be unqualified. I checked the target schema, and it did have
"elementformdefault" set to "qualified". So, I changed it to
"unqualified". I'm guessing there's no way to magically "reset" the
target schema association, so that the xslt would remove the namespace
prefixes. So, I tried creating a new mapper, and setting the same
source and target schema, and then started mapping elements again.
Oddly enough, the result shows that almost all of the elements from the
target schema are unqualified, except for the root element. For some
reason that is still qualified with the target namespace prefix. I
don't get it.
|Subject: XSLT mapper: If source "elementformdefault" is "unqualified", XSLT still needs to reference ns prefix|
Author: David Karr
Date: 09 Mar 2006 12:14 PM
I have two schemas, which we'll call "b" (source) and "a" (target) for
now. Both of them have "elementformdefault" set to "qualified"
initially. My sample message, however, has the elements unqualified. I
also need my result to be unqualified. My initial testing looks ok,
except for the ns prefixes. Note that both schemas have several
elements with the same name, like "UID", for instance. I'm not sure
whether this is relevant. So, I changed both schemas to be
"unqualified" and created a new mapper. I set the same source/target
schemas and mapped my elements, and ran the preview. For some reason,
all the elements were empty. I looked closer at the XSLT, and I noticed
that code that looked like this in the first try:
Now looked like:
For some reason, it left the ns prefix off the "UID" element reference.
I hand-edited it, adding the "b:" back in, and retested it, and it was
fine. It's curious that it mistakenly removed the prefix on the
sub-element, but not on the root element.
It appears that having the elementformdefault set to "unqualified" in
the source schema confused it a bit. That means the XML element will be
unqualified, but that doesn't have anything to do (I believe) with
whether the references in the XSLT should be qualified or not.