Need help XSLT
Here should go questions about transforming XML with XSLT and FOP.
Need help XSLT
Hello,
I have never worked in XSLT before and have a small need to generate a new xml based on an input xml file. Can someone help me here to create a basic xslt and i can take it from there and learn and adapt it to my requirement?
my input xml is something like this
From the above xml file, I need to check if i have tag and if yes, i need to check if i have . If exist i need to take the whole tag and put it in a new xml file.
So from the above xml, the output what i need is:
because from my input xml, the second Test tag has no value XYZ and 3rd Test tag has no name starting with CheckType_*. Can you help me with this?
I have never worked in XSLT before and have a small need to generate a new xml based on an input xml file. Can someone help me here to create a basic xslt and i can take it from there and learn and adapt it to my requirement?
my input xml is something like this
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<TestCode version="10.0">
<TestCategory name="SmokeTest">
<Test name="CheckType_123" type="String">
<Test_description>No description available for this Test</Test_description>
<context name="Testing">
<value>ABC</value>
<value>XYZ</value>
</context>
</Test>
<Test name="CheckType_PQR" type="String">
<Test_description>No description available for this Test</Test_description>
<context name="SmokeTest">
<value>ABC</value>
</context>
</Test>
<Test name="ValueAdded_123" type="String">
<Test_description>No description available for this Test</Test_description>
<context name="Testing">
<value>ABC</value>
<value>XYZ</value>
</context>
</Test>
</TestCategory>
</TestCode>
Code: Select all
<Test name=CheckType_*
Code: Select all
context/vlaue = XYZ
Code: Select all
<Test ...> </Test>
So from the above xml, the output what i need is:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<TestCode version="10.0">
<TestCategory name="SmokeTest">
<Test name="CheckType_123" type="String">
<Test_description>No description available for this Test</Test_description>
<context name="Testing">
<value>ABC</value>
<value>XYZ</value>
</context>
</Test>
</TestCategory>
</TestCode>
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