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?

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

could you replay on this Question stackoverflow.com/questions/42499903/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.