Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XML/XSL/XPATH how to get a element value [Thread Next] Re: XML/XSL/XPATH how to get a element valueTo: NULL Date: 9/7/2007 4:14:00 PM Kniffel wrote: > <Main> > <DisplayTime Aktiviert="True" /> > <PrintTime Aktiviert="True" /> > </Main> So the root element is the Main element with two child elements DisplayTime and PrintTime having an attribute Aktiviert. > <xsl:template name="PrintTime" match="PrintTime"> > <xsl:variable name="wert" select="name()" /> > <xsl:for-each select="@*"> > <xsl:variable name="PTattr" select="name()" /> > <xsl:variable name="PTattrwert" select="." /> > /****** Here I need a choose/when on the Element 'Aktiviert' of > DisplayTime: ******/ Aktiviert is not an element, it is an attribute of DisplayTime which is a sibling of PrintTime. So you can go to the common parent and then access the element and its attribute e.g. ../DisplayTime/@Aktiviert or you can access the sibling e.g preceding-sibling::DisplayTime/@Aktiviert -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
