|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XPath using descendant and negative matching
I have an xml file like this and I'm trying to create 2 templates: 1 that will match the elements with a Partners child 1 that will match elements without a Partners child I've got his far with one, but my Xpath must be wrong because only the Root tag is matched (or is displayed) rather than the UNB and NADBY elements <xsl:template match="*[descendant::*/Partners]"> it has Partners <xsl:value-of select="name()"/> </xsl:template> I was hoping the other Xpath would be something like <xsl:template match="*[descendant::*/[not Partners]]"> it has Partners <xsl:value-of select="name()"/> </xsl:template> <Invoice> <InvoiceNumber/> <DespatchNoteNumber/> <OrderNumber/> <NADBY> <Partners/> </NADBY> <UNB > <Partners/> </UNB> <AccountNo/> </Invoice> Thanks for your help ******************************************************* This email has originated from Perwill plc (Registration No. 1906964) Office registered at: 13A Market Square, Alton, Hampshire, GU34 1UR, UK Tel: +44 (0)1420 545000 Fax: +44 (0)1420 545001 www.perwill.com ******************************************************* Privileged, confidential and/or copyright information may be contained in this email, and is only for the use of the intended addressee. To copy, forward, disclose or otherwise use it in any way if you are not the intended recipient or responsible for delivering to him/her is prohibited. If you receive this email by mistake, please advise the sender immediately, by using the reply facility in your email software. We may monitor the content of emails sent and received via our network for the purposes of ensuring compliance with policies and procedures. This message is subject to and does not create or vary any contractual relationships between Perwill plc and the recipient. ******************************************************* Any opinions expressed in the email are those of the sender and not necessarily of Perwill plc. ******************************************************* This email has been scanned for known viruses using Sophos MailMonitor ******************************************************* 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








