|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL to generate XPaths
I found a couple of bugs in my XSL that showed up when an element had an attribute and child elements with the same names. > <!-- If this is an attribute node, output '@' before its name. --> > <xsl:if test="../@*[name() = name(current())]"> The correct test to see if the current node is an attribute is: count(.|../@*) = count(../@*) > <!-- > If the parent has more than one node with the same name as > the current one... > --> > <xsl:if test="count(../*[name() = name(current())]) > 1"> Here I needed to check if the current node is an element: count(.|../*)=count(../*) and count(../*[name()=name(current())]) > 1" If anyone wants the new version of the whole thing, please let me know. -- Michael Strasser Brisbane, Australia 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








