Putting the xml into a website

Questions about XML that are not covered by the other forums should go here.
felix1845
Posts: 10

Putting the xml into a website

Sat Jun 03, 2017 4:39 am

I have a wordpress account and would like to link the xml I made there. I have a stylesheet so I know it can be read in a browser, but copying and pasting the link created with "Transformation Scenario" doesn't work. Am I missing something straightforward?
Radu
Posts: 5088

Re: Putting the xml into a website

Mon Jun 05, 2017 8:13 am

Hi,

Usually when you have an XML document and you want to publish it online, you do not just upload the XML document with a CSS stylesheet.
You first convert the XML document to HTML using XSLT and upload the HTML document (which can refer to a CSS or contain embedded CSS).
As an example in the Oxygen samples project there is an XML document OXYGEN_INSTALL_DIR\samples\personal.xml and an XSLT stylesheet OXYGEN_INSTALL_DIR\samples\personal.xsl which can be applied on the XML by creating a transformation scenario to produce HTML.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
felix1845
Posts: 10

Re: Putting the xml into a website

Mon Jun 05, 2017 6:04 pm

Hi,

So I converted the xml to html using an xslt stylesheet, but the link in the browser still won't work when I try to make it a link on the website. What do you mean when you say "upload the html document"? Do you mean the xslt stylesheet? And I should upload this to Wordpress?

Alison
felix1845
Posts: 10

Re: Putting the xml into a website

Tue Jun 06, 2017 5:02 am

Can you clarify this? I have an xml document that has been converted to html with xslt. But this is still a file which I can't put onto a website, so there must be another step.

Thanks,
Alison
Radu
Posts: 5088

Re: Putting the xml into a website

Tue Jun 06, 2017 8:09 am

Hi Alison,

You should probably try to contact someone from Wordpress about your Wordpress related problems.
If after uploading an HTML document you have a broken link in it, it probably means that the file linked by the HTML document is not located anymore relative to the HTML document. So you probably also need to upload that file.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
felix1845
Posts: 10

Re: Putting the xml into a website

Tue Jun 06, 2017 5:23 pm

Well, I talked to the Wordpress people and they looked at the site and said it's definitely not their system, but the file itself. Which I agree with; I think I'm doing something wrong with the process of converting an xml document to html with xslt. So I have xml, xsl and css, and they're all separate files. Is there some way to combine them to make one html file? Or Do I just rename one of them .html?
adrian
Posts: 2326

Re: Putting the xml into a website

Tue Jun 06, 2017 6:16 pm

Hi,

The question is, what is the desired result? You want to upload the XML file as is (just keep it as XML and link to it), or the web page (HTML) representation/published format of that XML file (depends on how you transformed the XML with an XSLT)?

If you want to have it as HTML and it also links/refers to other resources (CSS, images) you'll need to upload the HTML and also those resources with it. The XSLT is not part of published resources, the XSLT is simply the catalyst for your transformations.
Before you involve Wordpress, you'll first want to check the generated HTML locally. Just open it in a web browser and check if it looks right. If it doesn't, your XSLT may need some additional work.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
felix1845
Posts: 10

Re: Putting the xml into a website

Wed Jun 07, 2017 10:44 pm

Hi,

The second one: I want to link to the HTML. I've checked it, by clicking on the Transformation Scenario, which then makes it appear in a tab of the browser. Is that what you meant? And it looks fine there. But now this tab is called

file:///C:/Users/aliso/Desktop/DH%20work/TEI/Marginalia%20in%20Mandeville's%20Travels%202.html

and apparently this doesn't when I try to make a link to it. So I guess I need to do something else?
adrian
Posts: 2326

Re: Putting the xml into a website

Thu Jun 08, 2017 10:19 am

That's a local file (see the file:/// protocol), you can't link to a local file from a website since only you have the file locally.
You need to upload the html (and resources) to a web server and link to it (a/@href) from another web page. Not sure what restrictions/limitations Wordpress has in this regard. I am not familiar with their services.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
felix1845
Posts: 10

Re: Putting the xml into a website

Wed Jun 14, 2017 9:17 pm

What do you mean when you say "upload the html and resources"? Are the resources the xslt and css files? I'm working on the Wordpress side of things, but they can't tell me anything about xml.

As far as I understand it, the xml file is meaningless without the xslt and the css to interpret it for a browser. So I have 3 separate files which need to work together. How do I combine them/upload them together?

Thanks.
adrian
Posts: 2326

Re: Putting the xml into a website

Tue Jun 27, 2017 2:20 pm

HI,

What do you mean when you say "upload the html and resources"? Are the resources the xslt and css files?

"Resources" are CSS+images and any other things you link to from your published HTML. XSLT is not needed after you obtained the HTML. XSLT is just the catalyst for obtaining the HTML.
The HTML is the result of the XML transformation with XSL (XML+XSL => HTML). HTML is the published result, so after obtaining the HTML, you no longer need the XML+XSL. Just upload the HTML.

XML+XSL are not meant for the web browser. There are ways to make them work in the browser, but that's not their purpose.

As far as I understand it, the xml file is meaningless without the xslt and the css to interpret it for a browser. So I have 3 separate files which need to work together. How do I combine them/upload them together?

For a web site you need the HTML+CSS+images (if any). You need to upload them separately. While it is possible to create an HTML with embedded CSS and images, that's a bit overkill (images are base64 encoded and HTML becomes huge).

You should be able to upload each file separately (HTML+CSS+images).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 0 guests