Generate closed tag
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Generate closed tag
When transforming into xml can I generated a closed tag?
In my xsl file I have
thanks,
Scott
In my xsl file I have
in the resulting document<origPlace/>
anyway to have the tag generated with as it is in the xsl file?<origPlace/></origin>
thanks,
Scott
-
- Posts: 9450
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Generate closed tag
Hi Scott,
Your example is quite unclear, do you mean that initially the XML element is collapsed like <x/> and then in the output file it is expanded like <x></x>?
Usually from what I tried most XSLT processors will output the empty tag in collapsed format. I tried with Saxon 6 and Saxon 9 and they both generated the collapsed form of the element.
You can try for example applying a copy XSLT stylesheet to the XML document:
There is no setting in Oxygen to control this when transforming.
What you can do is to open the result XML document in Oxygen and use the "Format and Indent" toolbar action on it. There is a format and indent setting which can be toggled to instruct Oxygen what form to use for empty elements, by default it collapses them.
Regards,
Radu
Your example is quite unclear, do you mean that initially the XML element is collapsed like <x/> and then in the output file it is expanded like <x></x>?
Usually from what I tried most XSLT processors will output the empty tag in collapsed format. I tried with Saxon 6 and Saxon 9 and they both generated the collapsed form of the element.
You can try for example applying a copy XSLT stylesheet to the XML document:
Code: Select all
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
What you can do is to open the result XML document in Oxygen and use the "Format and Indent" toolbar action on it. There is a format and indent setting which can be toggled to instruct Oxygen what form to use for empty elements, by default it collapses them.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Generate closed tag
Radu,
thanks for the quick reply.
I figured out how to do it.
If your input is <foo></foo>, the output is <foo/>
If your input is <foo/>, the output is <foo></foo>
counter intuitive but I've found Saxon is like that in many ways.
thanks again,
Scott
thanks for the quick reply.
I figured out how to do it.
If your input is <foo></foo>, the output is <foo/>
If your input is <foo/>, the output is <foo></foo>
counter intuitive but I've found Saxon is like that in many ways.
thanks again,
Scott
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