|
next
|
Subject: Re: SS5.0-127b: SXL XML not viewable in IE Author: Minollo I. Date: 21 Aug 2003 11:08 PM
|
Jeremy, thanks for the testcase.
I've been able to open the .xsl file in Stylus and preview it without any
problem; it works fine.
I have been able to reproduce the error you are talking about by opening
the .xml file and then asking XML editor to provide a IE preview of the
..xml file; that's when I get the error you mentioned.
Note that the two processes above described are pretty different:
- if you open a .xsl inside Stylus, you will enter the XSLT editor, where
you are able to debug and preview your stylesheet - specifying which XML
source the processor should use; in the same context you can choose to use
the internal Stylus processor, XalanJ or Saxon - all of them support step
by step debugging;
- if you open a .xml file inside Stylus, you will enter the XML editor,
whose goal is to let you edit/inspect the details of an XML document and
(possibly) associated schema. The "preview" button in XML editor gives you
a chance to have IE "interpret" your XML document and render it. This is
mostly useful if you have a .svg file, or any other XML document which IE
is able to render in a peculiar way. In your specific case, your XML
document contains a {?xml-stylesheet...?} PI, which instructs IE to display
the result of XSLT transformation where the XSLT source is specified in the
PI and the XML source is the one which is open in the XML editor. In that
case you are entirely relying on the IE (MSXML) processor, and we don't
have control on that. In your particular case it looks like the href
attribute in the {?xml-stylesheet...?} PI is pointing to an XSLT document
that cannot be retrieved - that's why you get the error you mentioned.
Hope this helps,
Minollo
|
next
|
Subject: Re: SS5.0-127b: SXL XML not viewable in IE Author: J Roberts Date: 08 Sep 2003 01:06 PM
|
Thanks for your help.
As it turns-out, the problem was a red herring for what my poor coordination of getting you the files, and checking different files on my system.
I did discover the real issue, but I'm not sure why it is the case:
When an XML file, that has an associated XSL file, contains:
<myRoot xmlns="http://www.someplace.com/stuff">
... then the XML file is displayed with the proper formatting as defined in the XSL -- however, it has no content from the XML file.
In otherwords, it is formatted and pretty (if output was HTML, for example), but none of the element or attribute values are populated into the final visible output.
Now, if the root is changed to:
<myRoot xmlns:xx="http://www.someplace.com/stuff">
... with a namespace qualifier, or simply ...
<myRoot>
... then everything works great, and the XML is formatted and populated.
Why does it fail when a default namespace is defined?
Thanks a bunch,
J. Roberts
|
next
|
Subject: Re: SS5.0-127b: SXL XML not viewable in IE Author: (Deleted User) Date: 08 Sep 2003 01:39 PM
|
Hi Jeremy,
At 13.29 08/09/2003 -0400, you wrote:
>From: "J Roberts"
>
>[...]
>When an XML file, that has an associated XSL file, contains:
>
><myRoot xmlns="http://www.someplace.com/stuff">
>
>... then the XML file is displayed with the proper formatting as defined
>in the XSL -- however, it has no content from the XML file.
>
>[...]
>Now, if the root is changed to:
>
><myRoot xmlns:xx="http://www.someplace.com/stuff">
>
>... with a namespace qualifier, or simply ...
>
><myRoot>
>
>... then everything works great, and the XML is formatted and populated.
>
>Why does it fail when a default namespace is defined?
If you are seeing this behavior, it means that the XSL file that you are
using is not handling the correct namespace.
In the first case, in fact, you are defining a default namespace
("http://www.someplace.com/stuff") where all the XML elements will be
placed. So, the XSL should try to use queries picking the data out of that
namespace, for instance:
<xsl:stylesheet xmlns:stuff="http://www.someplace.com/stuff" ....
....
<xsl:value-of select="/stuff:myRoot">
In the two cases you list as working, you are either associating the
namespace URI to a prefix ("xx") that you are not using, or not defining a
namespace at all; in these cases, the XML elements will not be placed in a
namespace, and queries like "/myRoot" succeed.
Hope this helps,
Alberto
|
|
|
|