XSLTOperation should not expand @class
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 160
- Joined: Mon Nov 24, 2014 1:49 pm
- Location: Greven/Germany
XSLTOperation should not expand @class
Hi,
I have a simple ro.sync.ecss.extensions.commons.operations.XSLTOperation for sorting DITA elements. After applying the XSL transformation, the @class attributes are expanded. Because we use DITA, we cannot deactivate the Saxon -expand parameter, because otherwise, elements cannot be selected with the @class selector anymore. So, is it possible (and how) to avoid, that the @class attributes are (permanently) expanded in the XML files?
Greetings,
Stefan
I have a simple ro.sync.ecss.extensions.commons.operations.XSLTOperation for sorting DITA elements. After applying the XSL transformation, the @class attributes are expanded. Because we use DITA, we cannot deactivate the Saxon -expand parameter, because otherwise, elements cannot be selected with the @class selector anymore. So, is it possible (and how) to avoid, that the @class attributes are (permanently) expanded in the XML files?
Greetings,
Stefan
stefan-jung.org – Your DITA/DITA-OT XML consultant
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XSLTOperation should not expand @class
Hi Stefan,
Have you tried instead of probably using xsl:copy-of to apply a copy template in a certain mode so that you can remove the @class attributes from the generated XML content?
Regards,
Radu
Have you tried instead of probably using xsl:copy-of to apply a copy template in a certain mode so that you can remove the @class attributes from the generated XML content?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 160
- Joined: Mon Nov 24, 2014 1:49 pm
- Location: Greven/Germany
Re: XSLTOperation should not expand @class
Hi Radu,
thanks for your reply. While reading more about modes, I figured out, that I could simply avoid the processing of the attribute by using match="@class".
So I came up with:
Thanks for your advice, you pointed me to the right direction.
Greetings,
Stefan
thanks for your reply. While reading more about modes, I figured out, that I could simply avoid the processing of the attribute by using match="@class".
So I came up with:
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"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
exclude-result-prefixes="xs xd"
version="2.0">
<xsl:output method="xml" indent="no" omit-xml-declaration="yes"/>
<!-- This line has helped -->
<xsl:template match="@class"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ul">
<xsl:copy>
<xsl:apply-templates select="li">
<xsl:sort select="(keyword | ph)/@id"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Greetings,
Stefan
stefan-jung.org – Your DITA/DITA-OT XML consultant
Return to “DITA (Editing and Publishing DITA Content)”
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