Possible to use embedded stylesheet in Transformation Scenario?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 88
- Joined: Wed Feb 11, 2015 11:25 pm
- Location: San Francisco, California USA
- Contact:
Possible to use embedded stylesheet in Transformation Scenario?
------
This is a "just curious" question inspired by a textbook example, not a real work problem.
The book provides the following XML as an illustration of an embedded stylesheet, id="petstyle":
Is it possible to configure an oXygen 17 Transformation Scenario to use this?
As I said, I'm merely curious. I only today learned how to configure a Transformation Scenario to use a linked stylesheet. Now I'm figuring out how to use an embedded stylesheet should the need arise (highly improbable it ever will, I think)...
Cheers & thanks,
Riley
SFO
This is a "just curious" question inspired by a textbook example, not a real work problem.
The book provides the following XML as an illustration of an embedded stylesheet, id="petstyle":
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="#petstyle"?>
<!DOCTYPE pets [<!ATTLIST xsl:stylesheet id ID #IMPLIED>]>
<pets>
<pet type="cat">Max</pet>
<pet type="parrot">Peter <color>red</color>
</pet>
<xsl:stylesheet id="petstyle" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="xsl:stylesheet"/>
<xsl:template match="pets"> My pets: <xsl:apply-templates/>
</xsl:template>
<xsl:template match="pet">
<xsl:value-of select="text()"/>
</xsl:template>
</xsl:stylesheet>
</pets>
As I said, I'm merely curious. I only today learned how to configure a Transformation Scenario to use a linked stylesheet. Now I'm figuring out how to use an embedded stylesheet should the need arise (highly improbable it ever will, I think)...
Cheers & thanks,
Riley
SFO
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Possible to use embedded stylesheet in Transformation Scenario?
Hi,
Xalan (XSLT 1.0) seems to accept embedded XSL, but Oxygen won't recognize the anchor in the href from the xml-stylesheet declaration, so you can't make use of the Use "xml-stylesheet" declaration option. You can create a scenario (XML transformation with XSLT), select Xalan from the Transformer combo and use in the XSL URL field:
TBH, it makes more sense to go the other way and just include the XML content within the XSL.
Regards,
Adrian
Possible, yes. But not in a comfortable way.RBVanDyke wrote:Is it possible to configure an oXygen 17 Transformation Scenario to use this?
Xalan (XSLT 1.0) seems to accept embedded XSL, but Oxygen won't recognize the anchor in the href from the xml-stylesheet declaration, so you can't make use of the Use "xml-stylesheet" declaration option. You can create a scenario (XML transformation with XSLT), select Xalan from the Transformer combo and use in the XSL URL field:
Code: Select all
${currentFileURL}#petstyle
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 88
- Joined: Wed Feb 11, 2015 11:25 pm
- Location: San Francisco, California USA
- Contact:
Re: Possible to use embedded stylesheet in Transformation Scenario?
Thanks Adrian for taking the time to respond with that excellent answer!
Cheers,
Riley
SFO
Cheers,
Riley
SFO
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