[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] xsl-value-of does not process xsl values?
Subject: Re: [xsl] xsl-value-of does not process xsl values? From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx> Date: Fri, 31 Aug 2001 10:11:19 -0400 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl-value-of does not pro, David Carlisle | Thread | [xsl] XPath position determination, s . livingstone |
[xsl] Find second character in a st, Paulo Henrique S. Be | Date | Re: AW: [xsl] Replacing all Occuren, David Carlisle |
Month |