Thursday 15 May 2014

xml - XSLT transform single attribute to element -


I am trying to convert an element into an element. I use xsl:

    

"@ String / ti" custom: attribute = "name" />

The above XSL elements change all the attributes, but I only change 'custom: attribute' and Thank you in advance.

replaced @ with @custom: attribute
so try :

  & lt; xsl: template match = "text view / @ custom: attribute" & gt; xsl: element name = "{name ()}" & gt; & lt ; Xsl: value selection = "." / / Gt; & lt; / XSL: element & gt; & lt; / XSL: template & gt;   

: custom is one. You need to add it to your XML in the stylesheet with the same name space url. Something like this:

  & lt ; Xsl: stylesheet xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" xmlns: custom = "CUSTOM_URL" version = "1.0" & gt;    

No comments:

Post a Comment