xml - Choose as value based on a selection -


If I have this XML input that I want to change:

  & lt; Money & gt; & Lt; Balance & gt; & Lt; Type & gt; & Lt; BalCode & gt; Family welfare & lt; / BalCode & gt; & Lt; / Type & gt; & Lt; Zodiac Ccy = "PHP" & gt; 4.00 & lt; / Zodiac & gt; & Lt; CreditDebit & gt; CRD & lt; / CreditDebit & gt; & Lt; Date & gt; 2013-08-19 & lt; / Date & gt; & Lt; / Balance & gt; & Lt; Balance & gt; & Lt; Type & gt; & Lt; BalCode & gt; OP & lt; / BalCode & gt; & Lt; / Type & gt; & Lt; Zodiac Ccy = "PHP" & gt; 5.00 & lt; / Zodiac & gt; & Lt; CreditDebit & gt; CRD & lt; / CreditDebit & gt; & Lt; Date & gt; 2013-08-19 & lt; / Date & gt; & Lt; / Balance & gt; & Lt; Balance & gt; & Lt; Type & gt; & Lt; BalCode & gt; CL & lt; / BalCode & gt; & Lt; / Type & gt; & Lt; Zodiac Ccy = "PHP" & gt; 6.00 & lt; / Zodiac & gt; & Lt; CreditDebit & gt; DBT & lt; / CreditDebit & gt; & Lt; Date & gt; 2013-08-19 & lt; / Date & gt; & Lt; / Balance & gt; & Lt; / Money & gt;   

And I should do something that is in my form as output:

    

How can I use XSLT

Thanks and relation

Try the following stylesheet: < Pre> & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Xsl: stylesheet xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" & gt; & Lt; Xsl: strip-space element = "*" /> & Lt; Xsl: output indent = "yes" omit-xml-declaration = "yes" /> & Lt; Xsl: template match = "/" & gt; & Lt; Balance & gt; & Lt; Balance sheet & gt; & Lt; Xsl: Select Value = "Money / Balance [Type / Child Code = 'CL]] / Date" /> & Lt; / BalanceDate & gt; & Lt; Xsl: copy-of select = "Money / Balance [Type / childcode = 'OP'] / zodiac" /> & Lt; Xsl: copy-of select = "Money / Balance [type / childcode = 'cl'] / zodiac" /> & Lt; / Balance & gt; & Lt; / XSL: Templates & gt; & Lt; / XSL: stylesheet & gt;

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -