|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Conditional extraction of data
Peter,
I think there are a lot of people on this list that will commend you for your desire to learn by your own efforts and merits before asking for the answer. Let me be the first... nice job! Now... moving forward to help you with solving your dillemma. The first thing you want to focus on is the difference between what xsl:value-of will output and what xsl:copy-of will output. Think of the difference like this... value-of will output the string value of the current element in context where as copy-of will make a deep copy of the element and all of its descendants. So, in other words... given the following XML... <foo> this is the value of foo <bar>this is the value of bar.<p>this is the value of a paragraph that is the child of bar</p></bar> </foo> <xsl:value-of select="foo"/> will output: "this is the value of foo" <xsl:value-of select="foo"/> will output a copy of all the text elements as well as the elements and there values that are descendants of foo. or: <foo> this is the value of foo <bar>this is the value of bar.<p>this is the value of a paragraph that is the child of bar</p></bar> </foo> If you were to use the xsl:copy element you could get selective of which elements or attributes to include in your copy. So, if I were you, I would do one of two things... rush out to your local Barnes & Noble or Borders (or equivalent) and pick up a copy of Dr. Michael Kays XSLT Developers Reference OR go to the W3C and take a look at the XSLT 1.0 specification, and focus specifically on the above elements... learn all about each of them... read the sections over and over and over again until you finally get it... sometimes this is what it takes. If after all this you still are having troubles come back to the list and showcase the fact that you have done all that you can and you still are having troubles and I know more than half the people on this list will be more than happy to help. Best of luck to you! <M:D/> Bradley, Peter wrote: It pays to be honest, so I'll be up-front about this. The question arises from an assignment on a course I'm doing.
|
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








