This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Best way to include code samples
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Best way to include code samples
- From: Mark Miller <storefront2000 at yahoo dot com>
- Date: Thu, 16 Aug 2001 11:00:27 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Larry,
I worked on this problem last month and received
replies from Evan, Chris Bayes and Dimitre. I was
trying to insert a 'copy' of XSLT code as examples in
an online, XML tutorial. That way, if the code was
changed, the code samples would be automatically
updated.
Chris has a solution he is working on, but I was not
able to get it working.
As you saw, Evan's is a little overkill for the size
project you have. However, we did exchange a couple of
emails. His solution worked as far as inserting the
code into the example boxes, but we found out that the
document() function outputs a string, not nodes,
therefore I wasn't able to format the output properly.
Dimitre's solution was interesting, but not what was
needed.
The closest I came to getting it to work was pulling
the code in with a document() function and then
building a conversion template for each tag name in
the example. It wasn't worth the effort for the
project I was working on, so I ended up
"cutting-and-pasting" the code in the example section.
You can see how it looks by going to:
www.storefront-solutions.com/
demos/xml-demo/courseware/toc.xml
Choose one of the chapters other than 'Overview' or
'Basics', drill down and you will see output of code
examples.
This is a tutorial system built on the fly with XSLT.
I tried to get code insertion working for the code
samples, but I finally gave up because of time
constraints.
I still intend to get it working. Please let me know
what you end up doing.
Mark
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list