0

could you please tell me how to append data in xslt on button click using jquery? I tried like this

 <button onclick='clickBtn()'>append</button>

JS function

function clickBtn(){
        console.log('=====')
          '<xsl:for-each select="//./body/name">
              <xsl:if test='number(position()) &gt;10'>
                  <li><xsl:value-of select="."/></li>
               </xsl:if>
          </xsl:for-each>'
          }

here is my code http://xsltransform.net/jz1PuQ7/8

any update?

user944513
  • 12,247
  • 49
  • 168
  • 318

1 Answers1

0

The output of your XSL is HTML. The output HTML is unaware of the XSL or XML data. What you're likely looking to do is add an element to the XML structure and re-execute the XSL transform.

Look here for an example of running an XSL transform using JavaScript: How can I use javascript to transform xml & xslt

Look here for adding a node to an XML structure (is the same in jQuery as with HTML Elements): jQuery 1.6.1 add a new node in XML

Community
  • 1
  • 1
thastark
  • 1,243
  • 10
  • 9
  • could you replay on this Question http://stackoverflow.com/questions/42499903/how-to-access-variable-in-xslt – user944513 Feb 28 '17 at 04:09