I've got some *.xml with elements like :
<app-method name="leave-accrual-status-details" kind="enquiry">
<title>...</title>
<required-roles>
<role name="authenticated"/>
</required-roles>
<asd>
<param name="..." datatype="dt:int" control="hidden" call-kind="..." data-kind="..."/>
</asd>
<data-engine sp="spLeaveAccrualStatusDetails">
...
</data-engine>
<wia>
...
</wia>
</app-method>
And generating new .xml-document (selecting only "app-method" elements).I'm doing it this way : (.xsl)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="xml" encoding="utf-8" indent="no"></xsl:output>
<xsl:template match="/">
<xsl:for-each select="//app-method">
<xsl:if test='./required-roles/role[@name="administrator"]'>
<xsl:copy-of select="." />
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
It's working perfectly, but.. Is there any way to do it without "xsl:copy-of"? Think I need to use something like "node-name('blabla')" and value-of?.. And how to select a set of methods parameters (distinct)? ( param name="parameter name" ), yeah I need to use "key" but can't find good samples with it
Many thanks
P.S When converting xml->xml I have to use Far("xsl in.xml transform.xsl out.xml"),'cause there is some strange error when trying to do it from cdm.exe, I dislike FAR a little bit,is there another way to convert xmls?