[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl-value-of does not process xsl values?

Subject: Re: xsl-value-of does not process xsl values?
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Fri, 31 Aug 2001 10:11:19 -0400
Re:  xsl-value-of does not process xsl values?
I'm not sure that the other responses to your question have clearly
addressed it, so I'll try.

The stylesheet processor responds to stylesheet instructions that are
located in the ***stylesheet***,  not anywhere else.  If you put something
that you think is a stylesheet instruction into the xml document that you
want to transform, it won't be treated as a stylesheet instruction, but only
like any other xml data.

There are several approaches you could take.

1) It is possible to combine an xml document and its stylesheet.  You have
to include a <stylesheet> element and there are some rules to follow to make
it work.

2) You could make a preliminary processing pass that creates a stylesheet,
then use that stylesheet to actually transform your document.  This is
possible but likely to be difficult to get working right.  Of course, it
takes another stylesheet to handle the first pass.

3) Think again about what you want to accomplish, and revise your xml file
design so that all the instructions are moved into the stylesheet.  If you
want to customize the handling, it is possible to import various other
stylesheets that can handle specific needs.  It is also possible to put all
kinds of customizing data into another xml file and get it using the
document() function.

What you can't do is to change the design of your stylesheet based on what
is in the source xml file.  The reason is that the stylesheet is compiled
before the transformation of your data is started.  This means you can't
decide what stylesheet to import based on the content of the xml document.

Cheers,

Tom P

[Phillip Rhodes]

> I have an xml document.  In this document, some of the element data is
> actually xsl.
>
> Example:
> <guide yearsOld="45">
> <text>You are <xsl:value-of select="/guide/@yearsOld"/> years old.</text>
> </guide>
>
> I do a transformation of this xml document, and I obtain the element
> content of the above element via another "xsl:value-of"
> Example: <xsl:value-of select="//text" />
>
> My problem is that the xsl is not being processed, it is treated as a
> string.  It is displayed literally as "<xsl:value-of
> select="/guide/@yearsOld"/>"  in my final transformed document.
>
> Can you tell me how I can fix this?
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.