Renaming XML tags if no attributes
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Wed Aug 12, 2009 8:16 am
Renaming XML tags if no attributes
Hi.
Does any one know if there is a way to rename an opening and its corresponding closing tag if it has no attributes, in XSLT.
For example –
<SampleTag>
<Innertag/>
</SampleTag>
I need to rename <SampleTag> to <OuterTag> and </OuterTag> as <SampleTag> does not have attributes.
Any help would be greatly appreciated.
Regards,
Jan
Does any one know if there is a way to rename an opening and its corresponding closing tag if it has no attributes, in XSLT.
For example –
<SampleTag>
<Innertag/>
</SampleTag>
I need to rename <SampleTag> to <OuterTag> and </OuterTag> as <SampleTag> does not have attributes.
Any help would be greatly appreciated.
Regards,
Jan
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Renaming XML tags if no attributes
Post by sorin_ristache »
Hello,
It can be renamed with a template like the following:
You should read an XSLT tutorial.
Regards,
Sorin
It can be renamed with a template like the following:
Code: Select all
<xsl:template match="SampleTag">
<OuterTag>
<xsl:apply-templates/>
</OuterTag>
</xsl:template>
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
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