Make Parents null if child is null
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Thu Jan 27, 2011 1:31 pm
Make Parents null if child is null
I have XML data where parent nodes exist in every record but child nodes do not.
Using XSL, is there anyway to create an if statement where if the child does not have a node (and any subsequent data), then do not create a parent node?
Really appreciate any code that can be posted.
Thanks
Using XSL, is there anyway to create an if statement where if the child does not have a node (and any subsequent data), then do not create a parent node?
Really appreciate any code that can be posted.
Thanks
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Make Parents null if child is null
Hello,
Could you give a small example of the XML file you have?
In theory you could test if the child exists with an XPath:
e.g. In the context of the parent
Regards,
Adrian
Could you give a small example of the XML file you have?
In theory you could test if the child exists with an XPath:
e.g. In the context of the parent
Code: Select all
<xsl:template match="parent">
...
<xsl:if test="child">
[create element]
</xsl:if>
...
</xsl:template>
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