Subject: [xsl] not condition is not working for my XSLT From: "Rahul Singh rahulsinghindia15@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 15 Sep 2016 18:52:02 -0000 |
Hi, I have written XSLT for get the output when Account/Id = '' from new5.xml and Contact/Id_c != Information/no from FTP and new5.xml , but my code is not responding, below is the both input xml and my xslt: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/ 1999/XSL/Transform"> <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/> <xsl:strip-space elements="*"/> <xsl:param name="tranFile" select="document('new5.xml')"/> <xsl:template match="Informations"> <xsl:choose> <xsl:when test="$tranFile/objects = ''"> <Informations> <xsl:copy-of select="Information"/> </Informations> </xsl:when> <xsl:when test="$tranFile/objects/Contact/Account/Id = ''"> <Informations> <xsl:for-each select="Information"> <xsl:variable name="aN" select="no"/> <xsl:if test="$tranFile/objects/Contact[Id_c != $aN]"> <xsl:copy> <xsl:apply-templates select="."/> </xsl:copy> </xsl:if> </xsl:for-each> </Informations> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> FTP.xml <?xml version="1.0" encoding="UTF-8"?> <Informations> <Information> <no>000817441</no> <ACCOUNTS> <ACCOUNT> <id>24</id> </ACCOUNT> </ACCOUNTS> </Information> <Information> <no>500817441</no> <ACCOUNTS> <ACCOUNT> <id>24</id> </ACCOUNT> </ACCOUNTS> </Information> <Information> <no>600817441</no> <ACCOUNTS> <ACCOUNT> <id>24</id> </ACCOUNT> </ACCOUNTS> </Information> </Informations> *new5.xml* <?xml version="1.0" encoding="UTF-8"?> <objects> <Contact> <Id>003j000001EhlwDAAR</Id> <ID_c>000817441</ID_c> <Account> <Id>a</Id> </Account> </Contact> <Contact> <Id>073j000001EhlwDAAR</Id> <ID_c>100817441</ID_c> <Account> <Id/> </Account> </Contact> <Contact> <Id>073j000001EhlwDAAR</Id> <ID_c>200817441</ID_c> <Account> <Id/> </Account> </Contact> </objects>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT not condition is not, Imsieke, Gerrit, le- | Thread | Re: [xsl] not condition is not work, Mukul Gandhi gandhi. |
Re: [xsl] XSLT not condition is not, Imsieke, Gerrit, le- | Date | Re: [xsl] not condition is not work, Mukul Gandhi gandhi. |
Month |