This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Namespaces issue


I have an issue with namespaces not being placed in my output document,
rendering them invalid.

I'm pretty sure I know exactly why, too. Question is, how can I fix this?

I work with data coming from a system that generates XML as attribute-normal
form, and escapes any XML entered into it (yuck). When I receive this data,
I'm trying to transform it to my own format using XSL. So far, so good.
Unfortunately, in order to do this, I have to use "disable-output-escaping"
in my stylesheet to properly extract the embedded XML. I've bitten this
bullet to get well-formed XML that I can then use in standard ways, which
also conforms to my own namespace definitions.

Yes, I know that d-o-e is not portable. Yes, I know it sucks. I would love
to use some other means, but none that I know of will work in my
environment. I have assurances that this won't be necessary in the next
version of the product that I receive output from, so it's a kludge until
then. I knew I might have some problems, and this is the first one I've been
unable to resolve cleanly. I'd appreciate it if the list could be spared the
usual spate of "d-o-e is bad, use something else" whenever the subject comes
up, because unfortunately I need to use it for my specific situation (at
least for a while). I have no choice at this juncture. As you can probably
guess, I'm not too happy about having to use it. :-)

Once I receive this mangled XML, the idea is to transform it into my own
standard XML, conformant to my own namespace definitions in a set of schema
documents. This way, I do it once, get it out of the way, and then have nice
pretty XML to play with. When I do the transformation, all works fine and
things have gone well until now. However, if the data I'm working with
contains a declaration like this, which references an namespace external to
my own:

<someelement xlink:type="simple" xlink:href="test.html">data</someelement>
(this is escaped when I receive it, requiring me to run it through an XSLT
transform to get the appropriate XML out)

The transformation still works, *but* the output document doesn't contain
the namespace declaration for the "xlink" namespace. The stylesheet and
schema both contain the appropriate declarations, but the transformation
process doesn't output the namespace declaration (I assume) because the tree
doesn't contain any nodes from that namespace until after the
transformation. So the resulting document is invalid by way of containing
references to undeclared namespace prefixes.

So I'd like to know if there's a way to force the output of a namespace
declaration via an XSLT transform, even if there's no nodes in the input
document that belong to that namespace. I'm using MSXML 4.0.

Regards and thanks for any responses,

Corey Snow


#########################################################
The information contained in this e-mail and subsequent attachments may be privileged, 
confidential and protected from disclosure.  This transmission is intended for the sole 
use of the individual and entity to whom it is addressed.  If you are not the intended 
recipient, any dissemination, distribution or copying is strictly prohibited.  If you 
think that you have received this message in error, please e-mail the sender at the above 
e-mail address.
#########################################################

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]