Can I use an XSLT instead of CSS for display in Author mode?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 3
- Joined: Sun Aug 08, 2010 5:58 pm
Can I use an XSLT instead of CSS for display in Author mode?
Hi,
a bit of a newbie here but...
I have built an XML database that I would like to be able to edit in Author mode.
Is it possible to associate an xslt file only in order to use the Author mode. I have tried and I still get the error message that I need to have a css file.
Or have I completely missed the idea here?
Cam
a bit of a newbie here but...
I have built an XML database that I would like to be able to edit in Author mode.
Is it possible to associate an xslt file only in order to use the Author mode. I have tried and I still get the error message that I need to have a css file.
Or have I completely missed the idea here?
Cam
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Can I use an XSLT instead of CSS for display in Author mode?
Hi Cam,
In order to properly edit an XML document in the Author page you need to associate a CSS file to it.
The CSS can either be associated with a top-level processing instruction like:
or by defining a custom document type in the Document Type Association preferences page. See this link for more details:
http://www.oxygenxml.com/doc/ug-oxygen/ ... l#d4e13805
Writing a CSS file for your XML is quite simple, see this example for instance:
http://www.oxygenxml.com/doc/ug-oxygen/ ... e-css.html
Regards,
Radu
In order to properly edit an XML document in the Author page you need to associate a CSS file to it.
The CSS can either be associated with a top-level processing instruction like:
Code: Select all
<?xml-stylesheet type="text/css" href="personal.css"?>
http://www.oxygenxml.com/doc/ug-oxygen/ ... l#d4e13805
Writing a CSS file for your XML is quite simple, see this example for instance:
http://www.oxygenxml.com/doc/ug-oxygen/ ... e-css.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Sun Aug 08, 2010 5:58 pm
Re: Can I use an XSLT instead of CSS for display in Author mode?
Thanks Radu,
I have built a rudimentary css for the elements in my xml document, but this seems like something that I am doing the hard way.
Is there a way to "export" the element tags (like you do for a DTD or Schema, to a css document, so one doesn't have to start from scratch?
Also, in the "Associate CSS / XSLT" button, one can associate an XSLT. Is that instead of or in addition to the css? - Can you give me an example of an instance where I could associate an XSLT?
Cheers,
Cam
I have built a rudimentary css for the elements in my xml document, but this seems like something that I am doing the hard way.
Is there a way to "export" the element tags (like you do for a DTD or Schema, to a css document, so one doesn't have to start from scratch?
Also, in the "Associate CSS / XSLT" button, one can associate an XSLT. Is that instead of or in addition to the css? - Can you give me an example of an instance where I could associate an XSLT?
Cheers,
Cam
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Can I use an XSLT instead of CSS for display in Author mode?
Hi Cam,
I do not think there is an easy way to extract all the element names from the DTD/XML Schema associated to the XML file. But if the XML file contains about all the used tags I think you can apply an XSLT on the XML to extract all element names. The XSLT content should be like:
You must use Saxon 9 to make the transformation as it has version 2.0.
Also in CSS you can use universal selectors like:
or use the same properties for multiple selectors like:
Here is a list with all CSS 2.1 selectors (almost all are supported by Oxygen):
http://www.w3.org/TR/CSS2/selector.html
About the dialog which can be used to associate an XSLT with an XML:
all it does is insert a standard processing instruction at the beginning of the XML file with the format:
That processing instruction can then be used by an application which processes the XML.
For example, if you have an XML with an XSLT associated in Oxygen and you try to transform it without having an associated scenario Oxygen will ask you if you want to perform the transformation based on the associated XSLT.
Also, if you open the same XML in many browsers they will perform the transformation and show you the transformed document instead. The same transformation can also be performed server-side when the HTTP server serves the XML file to the browser.
Regards,
Radu
I do not think there is an easy way to extract all the element names from the DTD/XML Schema associated to the XML file. But if the XML file contains about all the used tags I think you can apply an XSLT on the XML to extract all element names. The XSLT content should be like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="distinct-values(//local-name())"><xsl:value-of select="."/><xsl:text>
</xsl:text></xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Also in CSS you can use universal selectors like:
Code: Select all
*{
display:block;
}
Code: Select all
p, para{
display:block;
}
http://www.w3.org/TR/CSS2/selector.html
About the dialog which can be used to associate an XSLT with an XML:
all it does is insert a standard processing instruction at the beginning of the XML file with the format:
Code: Select all
<?xml-stylesheet type="text/xsl" href="path/to../stylesheet.xsl"?>
For example, if you have an XML with an XSLT associated in Oxygen and you try to transform it without having an associated scenario Oxygen will ask you if you want to perform the transformation based on the associated XSLT.
Also, if you open the same XML in many browsers they will perform the transformation and show you the transformed document instead. The same transformation can also be performed server-side when the HTTP server serves the XML file to the browser.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Fri Apr 23, 2004 3:04 pm
Re: Can I use an XSLT instead of CSS for display in Author mode?
This question should in fact be turned into a feature request.
I am working with Apache Forrest. The main underlying principle of Apache Forrest is to apply one XSL or a succession of XSL to XML documents in order to render them.
So there should be a possibility to do do just that in OxygenXML Author. In fact what is needed even is a succession of stylesheets followed by a CSS.
Best regards.
I am working with Apache Forrest. The main underlying principle of Apache Forrest is to apply one XSL or a succession of XSL to XML documents in order to render them.
So there should be a possibility to do do just that in OxygenXML Author. In fact what is needed even is a succession of stylesheets followed by a CSS.
Best regards.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Can I use an XSLT instead of CSS for display in Author mode?
Hi Antoine,
Our entire Author architecture is based on CSS styles.
We'll discuss your request but it's improbable as it would mean major changes in the Author architecture.
Regards,
Radu
Our entire Author architecture is based on CSS styles.
We'll discuss your request but it's improbable as it would mean major changes in the Author architecture.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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