Can you embed xsl style sheets in xml documents
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 5
- Joined: Thu Jun 29, 2006 5:53 pm
Can you embed xsl style sheets in xml documents
Hello
I have some xml that is generated on our server (dumpped from an SQL database) and I'd like to format it using an external XSL style sheet so that it appears in a friendly table for users in their browser.
My problem/question is this. Presumably the browser needs to download both the xml and the xsl files so I'm confused as to what to put in the href in the following declaration
<?xml-stylesheet type="text/xsl" href="??????"?>
If I just put the xsl file name doesn't it have to be in the same local directory? If so does this mean that I have to save it to the servers file system locally in the same folder as the style sheet? (Which I would rather avoid)
Should I publish the xsl somewhere globally available?, eg
http://www.acme.com/StyleSheets/FormPro ... erview.xsl
Or is there a way of embedding the xsl into the top of the xml as you can in html? so that it can all be sent back to the browser in one go.
Thanks for any advice.
Christian
I have some xml that is generated on our server (dumpped from an SQL database) and I'd like to format it using an external XSL style sheet so that it appears in a friendly table for users in their browser.
My problem/question is this. Presumably the browser needs to download both the xml and the xsl files so I'm confused as to what to put in the href in the following declaration
<?xml-stylesheet type="text/xsl" href="??????"?>
If I just put the xsl file name doesn't it have to be in the same local directory? If so does this mean that I have to save it to the servers file system locally in the same folder as the style sheet? (Which I would rather avoid)
Should I publish the xsl somewhere globally available?, eg
http://www.acme.com/StyleSheets/FormPro ... erview.xsl
Or is there a way of embedding the xsl into the top of the xml as you can in html? so that it can all be sent back to the browser in one go.
Thanks for any advice.
Christian
-
- Posts: 89
- Joined: Mon Mar 06, 2006 10:13 pm
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Can you embed xsl style sheets in xml documents
Post by sorin_ristache »
Hello,
You cannot embed the stylesheet in the XML file as Web browsers will handle it as a single XML file. There is no such extraction of the stylesheet from the XML file implemented in browsers. The path to the stylesheet specified in the href attribute can be a URL to a global XSL or can be a relative path to a local file but the XSL stylesheet does not have to be located in the same folder as the XML file. It can be stored in a subfolder, for example href="subfolder1/subfolder2/FormPropertiesOverview.xsl" or can be stored in a different folder, like href="../../otherFolder/FormPropertiesOverview.xsl".
Regards,
Sorin
You cannot embed the stylesheet in the XML file as Web browsers will handle it as a single XML file. There is no such extraction of the stylesheet from the XML file implemented in browsers. The path to the stylesheet specified in the href attribute can be a URL to a global XSL or can be a relative path to a local file but the XSL stylesheet does not have to be located in the same folder as the XML file. It can be stored in a subfolder, for example href="subfolder1/subfolder2/FormPropertiesOverview.xsl" or can be stored in a different folder, like href="../../otherFolder/FormPropertiesOverview.xsl".
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service