I need some XSLT 2.0 written to dynamically transform XML files .
The XML files come in pairs - a script file + data file. The XSLT must be able to handle variations of the script file and the data file.
You are going to have to understand XSLT well. I don't mind if you want to do multiple transforms (say 2 transforms) in to dynamically generate the resultant file.
The result should be:
<item><![CDATA[
VERSION
TABCORE
idWizardForm:tmNewAppSubmissionCategorySelect:1
idWizardForm:idBtnACTION_ID_NEXT
CONTENT=%MISS
CONTENT=LAW
CONTENT=Adam
CONTENT=LAW2
idWizardForm:tmNewAppSubmissionCategorySelect:1
idWizardForm:idBtnACTION_ID_NEXT
]]></item>
When generated from xmlfile1 such as
<file>
<Owners>
<Owner>
<Firstname>Adam1</Firstname>
<Surname>Law1</Surname>
<Type>1</Type>
</Owner>
<Owner>
<Firstname>Adam2</Firstname>
<Surname>Law2</Surname>
<Type>2</Type>
</Owner>
</Owners>
</file>
and xmlfile2 such as
<script>
<code>
<![CDATA[
VERSION
TABCORE
]]>
</code>
<loop>
<loop_variables>
<name>$n</name>
<start>1</start>
<increment>1</increment>
<condition> < count($doc//Owners//Surname[matches(.,'[A-Z]+','i')]}}</condition>
</loop_variables>
<if>
<if_variables>
<condition>
<![CDATA[ 1 = $doc//Owners//Type[$n] ]]>
</condition>
</if_variables>
<true>
<code>
<![CDATA[
idWizardForm:tmNewAppSubmissionCategorySelect:1
idWizardForm:idBtnACTION_ID_NEXT
CONTENT=%MISS
CONTENT={{$doc//Owners//Surname[{{n}}]}}
CONTENT={{$doc//Owners//Firstname[{{n}}]}}
]]>
</code>
</true>
<false>
<code>
<![CDATA[
idWizardForm:tmNewAppSubmissionCategorySelect:1
idWizardForm:idBtnACTION_ID_NEXT
]]>
</code>
</false>
</if>
</loop>
</script>
Hi
Hope you well !
I am Vinod Kumar. I am working as Senior Software Developer in IT company. I have 4 + years experience in .NET with C#,VB,ASP.NET, Web Service, WCF, Javascript, JQuery, SQL, XML ,XSLT and HTML.