The copy and copy-of structures are used to copy nodes. The copy element only copies the current node without any nodes or attributes. But copy-of is all copied.
XSLT stylesheet 1
XML source code<Source> <P id = "A12"> compare <B> these constructs </B>. </P> </Source> Output<Div> <B> copy-of: </B> <P id = "A12"> Compare <B> these constructs </B>. </P> </Div> <Div> <B> copy: </B> <P/> </Div> <Div> <B> value-of: </B> Compare these constructs. </Div> View in HTMLCopy-: CompareThese constructs. Copy: Value-:Compare these constructs. |
XSLT stylesheet <XSL: stylesheet version = '1. 0' Xmlns: XSL = 'HTTP: // www.w3.org/5o/#/transform'> <XSL: template match = "p"> < Div > < B > <XSL: Text> copy-of: </XSL: Text> </ B > <XSL: copy-of select = "."/> </Div > < Div > < B > <XSL: Text> copy: </XSL: Text> </ B > <XSL: copy/> </ Div > < Div > < B > <XSL: Text> value-of: </XSL: Text> </ B > <XSL: value-of select = "."/> </ Div > </XSL: Template> </XSL: |