Viewing transformed files in a browser

Here should go questions about transforming XML with XSLT and FOP.
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Viewing transformed files in a browser

Post by jsb »

I can use oXygenXML to transform my .xml document (without error) using my XSL transform file, but I cannot yet download my XML file from the web in IE 6 and have it automatically transform the XML file into the desired HTML file. I've looked into this and I believe I am doing everything I am supposed to do - though obviously I'm still doing something wrong.

The error I get in my browser is:
The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed ...
Here's the first few lines of my .xml file:

Code: Select all

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://www.jsbsim.org/JSBSim.xsl"?>
<fdm_config name="General Dynamics F-16A" version="2.0" release="BETA">
...
</fdm_config>
Here's the first few lines of my .xsl file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="/fdm_config">
...
</xsl:stylesheet>
Any suggestions?

Thanks,

Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Jon,

(I moved yout topic to the XSLT forum, please note that the XML Schema forum is for XML Schema related questions).

If I open your XML document is a browser I can see as result "..." which is probably what I should see as your input does not contain much information. Make sure you can see the styelsheet from your browser by opening the stylesheet URL in the same browser.

Best Regards,
George
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Also, note that the IE browser uses another XSLT engine, MSXML 3.0 I think. Try performing the transformation from oXygen selecting the same engine and see what results do you get as they may be different from what Saxon gives you.

Best Regards,
George
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Post by jsb »

george wrote:Hi Jon,

(I moved yout topic to the XSLT forum, please note that the XML Schema forum is for XML Schema related questions).

If I open your XML document is a browser I can see as result "..." which is probably what I should see as your input does not contain much information. Make sure you can see the styelsheet from your browser by opening the stylesheet URL in the same browser.

Best Regards,
George
I totally brain-farted. I'm working on a schema and a transform at the same time. Usually very late at night. Thanks,

Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Post by jsb »

george wrote:Hi Jon,

(I moved yout topic to the XSLT forum, please note that the XML Schema forum is for XML Schema related questions).

If I open your XML document is a browser I can see as result "..." which is probably what I should see as your input does not contain much information. Make sure you can see the styelsheet from your browser by opening the stylesheet URL in the same browser.

Best Regards,
George
George:

The "..." in my document is meant to mean "more information" - I didn't include my entire document!

I have opened my XSLT document at the URL specified, in my web browser. That works. The actual XML document can be seen here:

http://cvs.sourceforge.net/viewcvs.py/* ... xt%2Fplain

With the above document, the error message indicates that the "specified document cannot be found" - I guess that means the XSL file. I'm stumped.

I'll try your other suggestions, too.

Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Jon,

I saved the file locally to have an xml extension to it and IE shows something, not really understandable but there are some input fields there and no error message.

Best Regards,
George
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Post by jsb »

george wrote:Hi Jon,

I saved the file locally to have an xml extension to it and IE shows something, not really understandable but there are some input fields there and no error message.

Best Regards,
George
Hi, George:

Hmm. The download may be giving you something inaccurate. What the URL I gave should lead you to is a text representation of the "f16.xml" file, in our CVS repository. To see the file, maybe it's best to go here:

http://cvs.sourceforge.net/viewcvs.py/j ... 1&view=log

Then, notice this line near top:

"Bookmark a link to HEAD: (view) (download) (as text)"

Click on the "view" text to see the content of the file as processed by Explorer with it's own transformation. Click on the "download" link to actually download it - THIS is the action that should lead to the file being transformed and converted to HTML and displayed in the browser. The error message seems to indicate that the .xsl file (JSBSim.xsl) cannot be found or accesed. However, I can view that file in my browser at:

http://www.jsbsim.org/JSBSim.xsl

It has just occurred to me, though, that perhaps the permissions on the .xsl file are not extensive enough to allow the file to be used to transform my xml file. This is the part I do not understand. It seems that somehow my JSBSim.xsl file is not being served properly. If I save both files locally and change the reference in my f16.xml file to point to a local copy of the JSBSim.xsl file, the transform works. When I try to do this all over the web, it does not work.

Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Jon,

Yes, I can reproduce the problem with that file... I get:

Access is denied. Error processing resource 'http://www.jsbsim.org/JSBSim.xsl'.

This may be a security issue because the XML file is on a different domain than the XSL file. Just a guess.

Best Regards,
George
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Post by jsb »

george wrote:Also, note that the IE browser uses another XSLT engine, MSXML 3.0 I think. Try performing the transformation from oXygen selecting the same engine and see what results do you get as they may be different from what Saxon gives you.

Best Regards,
George
How would I use the MSXML engine? I didn't see that as one of the transformers I could select.

Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

Both the MSXML 3 and MSXML 4 engines are included in <oXygen/>. Select one of them in the edit scenario dialog (Configure transformation scenario - Edit), the Transformer combo box.

Regards,
Sorin
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Post by jsb »

sorin wrote:Hello,

Both the MSXML 3 and MSXML 4 engines are included in <oXygen/>. Select one of them in the edit scenario dialog (Configure transformation scenario - Edit), the Transformer combo box.

Regards,
Sorin
Thanks. I did that. I actually got the same result in appearance.

Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Post by jsb »

george wrote:Hi Jon,

Yes, I can reproduce the problem with that file... I get:

Access is denied. Error processing resource 'http://www.jsbsim.org/JSBSim.xsl'.

This may be a security issue because the XML file is on a different domain than the XSL file. Just a guess.

Best Regards,
George
jsbsim.org is the same thing as jsbsim.sourceforge.net.

I did find out one thing: If I place my XML file-to-be-transformed in the base directory at the web site: http://www.jsbsim.org - that is: http://www.jsbsim.org/f16.xml, after modifying the xml-stylesheet line to look like this:

<?xml-stylesheet type="text/xsl" href="JSBSim.xsl"?>

then the file is downloaded and transformed as desired:

http://www.jsbsim.org/f16.xml

That is, the xsl file is in the same location (same directory) as the source XML file. Now, it seems to me that sort of defeats the purpose of having an "href" attribute if one cannot specify an URL for where the XSL file resides. I'll try looking at the w3 site.

Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Jon,

I think that this is not something the specification should respond to but rather a security issue with IE. Maybe you should better try an IE related list?

Best Regards,
George
jsb
Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA
Contact:

Post by jsb »

george wrote:Hi Jon,

I think that this is not something the specification should respond to but rather a security issue with IE. Maybe you should better try an IE related list?

Best Regards,
George
It happens with Mozilla, too.
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
Post Reply