xslt attributes
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Mon Oct 03, 2005 6:29 pm
xslt attributes
Hi, I have an xml file. I am trying to get the data from this by using the xslt.
my xml is as follows,
xml
<code>898</code>
<name>ndskdj</name>
---
<xsl:template match="tlkpSpec">
<!-- <code><xsl:apply-templates select="LOC"/></code> -->
<!-- <name><xsl:apply-templates select="NAME"/></name> -->
<Lookup value="should put code value here"> <xsl:apply-templates select="SPECIAL"/></Lookup>
</xsl:template>
</xsl:stylesheet>
--
The problem is is that i need to take the value of code and place it into my lookup value?. Is there a way of doing this. Alternativley, i need to create an incrementing number for each value. Please can someone help?.
Thanks
my xml is as follows,
xml
<code>898</code>
<name>ndskdj</name>
---
<xsl:template match="tlkpSpec">
<!-- <code><xsl:apply-templates select="LOC"/></code> -->
<!-- <name><xsl:apply-templates select="NAME"/></name> -->
<Lookup value="should put code value here"> <xsl:apply-templates select="SPECIAL"/></Lookup>
</xsl:template>
</xsl:stylesheet>
--
The problem is is that i need to take the value of code and place it into my lookup value?. Is there a way of doing this. Alternativley, i need to create an incrementing number for each value. Please can someone help?.
Thanks
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Hi,
In order to achieve your goal the Lookup element should be inserted like this in your xsl file:
Of course the value of the select expression should point to the correct text value of the code element.
You can find more information about the use of xsl:element here:
http://www.w3schools.com/xsl/el_element.asp
Best regards, Radu.
In order to achieve your goal the Lookup element should be inserted like this in your xsl file:
Code: Select all
<xsl:element name="LookupCombo">
<xsl:attribute name="value">
<xsl:value-of select="//code/text()"/>
</xsl:attribute>
</xsl:element>
You can find more information about the use of xsl:element here:
http://www.w3schools.com/xsl/el_element.asp
Best regards, Radu.
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