preserve format
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 84
- Joined: Wed Jul 19, 2017 6:04 pm
- Location: Austria
- Contact:
preserve format
Hi,
when using refactoring in oXygen, the formatting is preserved, .e. g. the following example remains the same:
When using an external XSLT and applying it with the transformation scenario, the formatting is changed, the output looks like this:
Is this an XSLT- or oXygen-specific option and is it possible to implement it for XSLT transformations?
Thanks.
when using refactoring in oXygen, the formatting is preserved, .e. g. the following example remains the same:
Code: Select all
<zone data="#m1_k589_" lrx="469" lry="1125" type="measure" ulx="321" uly="204" xml:id="zoneOf_measure1"/>
Code: Select all
<zone data="#m1_k589_"
lrx="469"
lry="1125"
type="measure"
ulx="321"
uly="204"
xml:id="zoneOf_measure1"/>
Thanks.
Kind regards,
Oleksii Sapov-Erlinger
Oleksii Sapov-Erlinger
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: preserve format
Hello,
The output of an XSLT transformation depends on the XSLT transformer being used and how that transformer is configured to serialize the output. Generally speaking, even an XSLT that just copies the input XML to the output, may have an output with significant changes in the formatting from the input.
What refactoring actions did you use in Oxygen?
Many of the refactoring actions are actually implemented using XQuery Update, not necessarily XSLT.
Regards.
Adrian
The output of an XSLT transformation depends on the XSLT transformer being used and how that transformer is configured to serialize the output. Generally speaking, even an XSLT that just copies the input XML to the output, may have an output with significant changes in the formatting from the input.
What refactoring actions did you use in Oxygen?
Many of the refactoring actions are actually implemented using XQuery Update, not necessarily XSLT.
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: 84
- Joined: Wed Jul 19, 2017 6:04 pm
- Location: Austria
- Contact:
Re: preserve format
Hi Adrian
most often I use "Attributes" and sometimes "Elements". Normally, I use Saxon PE 9.8, is it possible to configure it that way in oXygen?
best regards
most often I use "Attributes" and sometimes "Elements". Normally, I use Saxon PE 9.8, is it possible to configure it that way in oXygen?
best regards
Kind regards,
Oleksii Sapov-Erlinger
Oleksii Sapov-Erlinger
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: preserve format
Hi,
It's not possible to configure an XSLT transformation that automatically detects the input XML formatting and keeps the same formatting in the output.
You can manually adjust the formatting/serialization options within the XSLT in the xsl:stylesheet/xsl:output element so that it mimics the formatting of the input XML:
e.g.
Saxon allows fine-tuning the serialization with some extra parameters.
See Saxon - Additional serialization parameters
Regards,
Adrian
It's not possible to configure an XSLT transformation that automatically detects the input XML formatting and keeps the same formatting in the output.
You can manually adjust the formatting/serialization options within the XSLT in the xsl:stylesheet/xsl:output element so that it mimics the formatting of the input XML:
e.g.
Code: Select all
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/">
<xsl:output method="xml" indent="yes" saxon:indent-spaces="2"/>
See Saxon - Additional serialization parameters
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: 84
- Joined: Wed Jul 19, 2017 6:04 pm
- Location: Austria
- Contact:
Re: preserve format
Thank you Adrian,
the indentation works fine but the attributes are still expanded. On a short view, I didn't find the appropriate setting like in the Saxon documentation. I wonder how it works in oXygen Refactoring that the format remains the same?
Regards,
Oleksii
the indentation works fine but the attributes are still expanded. On a short view, I didn't find the appropriate setting like
Code: Select all
expand-attributes: no
Regards,
Oleksii
Kind regards,
Oleksii Sapov-Erlinger
Oleksii Sapov-Erlinger
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: preserve format
Hi,
Default attributes are expanded at XML parsing time (first step) when building the XML document model.
There is a Saxon option mentioned in the Oxygen documentation, Advanced Saxon HE/PE/EE XSLT Transformation Options
Edit the transformation scenario that you are using (must use Saxon 9.x), press the "Advanced options" (cogwheel) button and clear the box for "Expand attributes defaults (-expand)".
Regards,
Adrian
Default attributes are expanded at XML parsing time (first step) when building the XML document model.
There is a Saxon option mentioned in the Oxygen documentation, Advanced Saxon HE/PE/EE XSLT Transformation Options
Edit the transformation scenario that you are using (must use Saxon 9.x), press the "Advanced options" (cogwheel) button and clear the box for "Expand attributes defaults (-expand)".
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
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