Modify value of an Attribute using XSLT
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Fri Dec 11, 2020 3:28 am
Modify value of an Attribute using XSLT
Post by roxyrollers »
I am generating a Graph from Oracle Reports which is working well as far as plotting the points. However, I have hit a brick wall while working with XSLT (Complete novice here in the field). The Attribute markerShape is used to plot the different symbols in the Graph. However, because my Data is dynamic, I have to achieve this using XSLT.
What I am trying to achieve: I have a column called category which is based on a Query in Oracle Reports. The rules are as follows:
What I am trying to achieve: I have a column called category which is based on a Query in Oracle Reports. The rules are as follows:
- When category = 1 then markerShape = 'MS_CIRCLE'
When category = 2 then markerShape = 'MS_DIAMOND'
When category = 3 then markerShape = 'MS_SQUARE'
When category = 4 then markerShape = 'MS_PLUS'
Code: Select all
<rw:graph id="CT_1" src="G_category" groups="x_date" dataValues="category">
<!--
<?xml version="1.0" ?>
<Graph version="2.6.0.23" graphType="LINE_VERT_ABS">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:param name="pNewMarkerShape" select="'MS_CIRCLE'"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="SeriesItems/Series/@markerShape">
<xsl:attribute name="markerShape">
<xsl:value-of select="$pNewMarkerShape"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
<SeriesItems>
<Series id="0" markerShape="MS_NONE" lineWidth="1" color="#FFFFFF"/>
</SeriesItems>
</Graph>
-->
</rw:graph>
-
- Posts: 9421
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Modify value of an Attribute using XSLT
Hi,
Maybe you should start by finding tutorials to learn XSLT. We have this past webinar for example:
https://www.youtube.com/watch?v=-Ssc4dXRPto
There is also this Udemy course with a number of free lessons:
https://www.udemy.com/course/practical- ... and-xpath/
Other than that it is not quite clear to me what you want, maybe you can post a small XML sample and a small XSLT and give more details because right now you seem to have an XML document with XSLT inside it which does not make sense.
Regards,
Radu
Maybe you should start by finding tutorials to learn XSLT. We have this past webinar for example:
https://www.youtube.com/watch?v=-Ssc4dXRPto
There is also this Udemy course with a number of free lessons:
https://www.udemy.com/course/practical- ... and-xpath/
Other than that it is not quite clear to me what you want, maybe you can post a small XML sample and a small XSLT and give more details because right now you seem to have an XML document with XSLT inside it which does not make sense.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
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