Return all row Value
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Mon Dec 30, 2013 8:42 am
Return all row Value
Post by vivekfriend »
Hi
I am using Oxygen XML Editor 15.1
There are 3 rows in one node element i.e. testnode
Now I need to fetch this rows data and display in a table (HTML)
Currently I a using following code:
Now problem in above code is there are 3 rows in node so currently there are 3 rows display but value of all rows are same as first row value.
What is the problem?
I am using Oxygen XML Editor 15.1
There are 3 rows in one node element i.e. testnode
Now I need to fetch this rows data and display in a table (HTML)
Currently I a using following code:
Code: Select all
<xsl:for-each select="/ns1:Resource/ns1:testpath/ns1:ExceptionMessage" xmlns:ns1="http://webservicepath">
<xsl:element name="tr">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:element name="td">
<xsl:attribute name="align">left</xsl:attribute>
<font name="verdana" size="3">
<xsl:attribute name="width">120</xsl:attribute>
<i>
<xsl:value-of select="/ns1:Resource/ns1:testpath/ns1:ExceptionMessage/ns1:Message/text()" xmlns:ns1="http://webservicepath"/>
</i>
</font>
</xsl:element>
</xsl:element>
</xsl:for-each>
What is the problem?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Return all row Value
Hi,
The problem is the xsl:value-of/@select. Because you're using an absolute XPath inside the xsl:for-each, you are ignoring the current context (the current for-each item).
So, since the current context is an item from /ns1:Resource/ns1:testpath/ns1:ExceptionMessage, instead of:
you should use:
Regards,
Adrian
The problem is the xsl:value-of/@select. Because you're using an absolute XPath inside the xsl:for-each, you are ignoring the current context (the current for-each item).
So, since the current context is an item from /ns1:Resource/ns1:testpath/ns1:ExceptionMessage, instead of:
Code: Select all
<xsl:value-of select="/ns1:Resource/ns1:testpath/ns1:ExceptionMessage/ns1:Message/text()" xmlns:ns1="http://webservicepath"/>
Code: Select all
<xsl:value-of select="ns1:Message/text()" xmlns:ns1="http://webservicepath"/>
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
-
- Posts: 2
- Joined: Mon Dec 30, 2013 8:42 am
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