xml - transform only the specified elements, dropping the rest -


I am trying to develop an XSLT stylesheet that will transform an XML with another in mind: / P>

  1. By default, the stylesheet should not display anything for every element (not even the text).
  2. If there is a clear template match for an element, then copy that element, the attributes and all its sub-values ​​(and their properties)

the second In words, the identity only clearly converts specified elements.

Well, there is definitely nothing to do for anything:

  & lt; Xsl: template match = "/ *" & gt; & Lt; XSL: Copy & gt; & Lt; Xsl: Apply-Select Template = "*" /> & Lt; / XSL: Copy & gt; & Lt; / XSL: Templates & gt; & Lt; Xsl: template match = "*" & gt; & Lt; Xsl: Apply-Select Template = "*" /> & Lt; / XSL: Templates & gt;  

Then you do want to add matches:

  & lt; Xsl: template match = "foo; bar" & gt; & Lt; Xsl: copy-of select = "." / & Gt; & Lt; / XSL: Templates & gt; However, it seems like an  lot  unusual requirement, generally you use those matches which navigate through known knowledge of XML to the known content. We do. 


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -