|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: using default params?
> David, > very nice explanation of xsl:copy-of hmm but it obviously didn't have the intended effect of explaining the code:-) > But could you explain further how the code you present would set a default > value for the attribute? > > > > > <table border="1001" > > > <xsl:copy-of select="@border"/> (I corrected a typo in my original: it had ! instead of ", which is easily done if typing on a UK keyboard with your eyes closed, and a duplicated word border which was added by a cosmic ray after I posted the message) <table border="1001" > makes a n element node with name table and one attribute node with name border <xsl:copy-of select="@border"/> either does nothing, in which case you get what you have above or it generates an attribute node with name border. XSLT specifies that if you add two attribute nodes of the same name to an element the first one is discarded. So in this case the original attribute node with value 1001 is replaced by the border attribute copy-of'ed from the source tree. So effectively you get a copy of the original except that you get a default value of 1001 in the case when there was no border attribute originally. David 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








