|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: copy-of question
Jeni, thanks again for the good explanation. Now I am beginning to understand... Franz > Hi Franz, > > > Jeni, I don't have a deep copy here (I want the complete original > > html table inside the xml), but only the table text cells as output > > Sorry - I don't understand what you mean by the above. Let me try > again. You said: > > > how can I extract only one element in original form? > > copy-of seems to work here, but I have all the other unwanted tags also as > > plain text. > > Is this related to the default rules? > > > > <xsl:template match="TABLE"> > > <xsl:copy-of select="."/> > > </xsl:template> > > If this is the only template you have in your stylesheet, it will give > you a (deep) copy of any TABLE elements in your document. The rest of > the nodes in the stylesheet (aside from those under the TABLE > elements) will have the built-in templates applied to them. The > effect of these built-in templates is that you get the text of the > rest of the document output. > > If you don't want that text to be output, then adding the empty > template: > > <xsl:template match="text()" /> > > will stop it being output. You'll still get the (deep) copy of the > TABLE elements, but this seemed to be what you were after (you said > that was working). > > If you have a stylesheet with these two templates in it, and you're > only getting the text of the table cells in your output, then I bet > you've got an xsl:output instruction that looks like: > > <xsl:output method="text" /> > > Take out that xsl:output instruction, or replace it with one that > looks like: > > <xsl:output method="xml" /> > > If you use the 'text' method, the XSLT processor doesn't output any > elements that you create, only text nodes. > > I hope that helps, > > Jeni > > --- > Jeni Tennison > http://www.jenitennison.com/ > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > 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








