[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Exclusions in XPATH
XPATH help appreciated ! XML: <A> <B> <C>101</C> <D> <E W="XYZ">0204268270</E> <F> <G>Versicherungsstr. 1</G> <H>Offenburg</H> </F> </E> </D> </B> </A> XSL: <xsl:template match="A"> <xsl:for-each select="./*[1]//*[not(*)]|./*[1]//@*[not(*)]"> <xsl:value-of select="name()"/> <xsl:if test="position()!=last()">;</xsl:if> </xsl:for-each> <xsl:apply-templates/> </xsl:template> This gives me output of: C;E;W;G;H Question 1: Can I get both attribute-names and element-names more easily in the select or does it have to be like I have it above ? If I only know the element-names A and F Question 2: How can I exclude the descendants of element F from the select ? Output would then be C;E;W. I've tried various combinations but either end up with all-or-nothing. Thanks in advance, Robin 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
|