|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Identifying two tags that share some attribute nam
Hello Zack,
I have a solution, but I don't know whether it's the optimum. I didn't get it with one expression and need the step with $test: <xsl:variable name="file1" select="/"/>
<xsl:variable name="file2" select="document('2.xml')/outsidedata"/><xsl:template match="/">
<xsl:apply-templates select="$file2/b"/>
</xsl:template><xsl:template match="b"> <xsl:variable name="test"> <xsl:for-each select="@*"> <xsl:if test="$file1/a/@*[name()=name(current())][. != current()] or not($file1/a/@*[name()=name(current())])"> <xsl:text>false</xsl:text> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:if test="not(contains($test, 'false'))"> <xsl:text>[</xsl:text> <xsl:value-of select="."/> <xsl:text>]</xsl:text> </xsl:if> </xsl:template> I test on every attribute whether it is in <a> and has a different value or it does completely not exist. If it is so I add a false to the test-string. If no 'false' is contained in $test, the value of b will be copied to the output. Regards, Joerg Zack Brown schrieb: Hi folks, XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








