xml - XSLT beginner query -
I have some similar XML structures, which I want to be able to properly process in XSLT so that users see online Can
first:
& lt; Table Type TYPEABBRV = "MTHPRTSTS" TOTALINDICATOR = "N" & gt; & Lt; Category type = "DISABSTATUS" VALUE = "WDIS" /> & Lt; Status & gt; MET & lt; / Status & gt; & Lt; / TABLETYPE & gt;
Next:
& lt; TABLETYPE TYPEABBRV = "ELEMIDADNIND" & gt; & Lt; Status & gt; METADDIND & lt; / Status & gt; & Lt; / TABLETYPE & gt;
What I have to do is to ensure that I do not get the value of both by examining the existence of "CATEGORY" when "status" is displayed. If "category" exists, then a block output of code. If not, then a separate block I know that I should use "XSL: Selection" and "XSL: When" but can not determine if "CATEGORY" exists or not. Thanks in advance for watching and answering I should add that these 2 blocks of XML are in different files.
After reading the first answer, I realized that I should probably clarify further. What is the goal between "position", it is to be produced.
I found a way to rearrange and change the code by using the answer given below for a solution. Thanks!
Test = "CATEGORY"How to check that "CATEGORY" exists
If CATEGORY
is present, then the truth will come back more precise - as the XSLT is very context-dependent - if it is in the current node If there is a child element named "CATEGORY" then this will be true, so if you are in the context of TABLETYPE
then:
& Lt; / XSL: When & gt; & Lt; XSL: otherwise & gt; & Lt; Xsl: value selection = "status" /> & Lt; / XSL: otherwise & gt; & Lt; / XSL: Select & gt;
should work for you.
Comments
Post a Comment