Re: how XSLT grouping works?
- From: Jan Eliasen <eliasen@xxxxxxxxxxxxx>
- Date: Tue, 05 Feb 2022 19:41:12 +0100
On Tue, 5 Feb 2022 08:31:08 -0800, Siva <siva@xxxxxxxxxxxxxxxxx>
wrote:
Thank you Jan, I used the full namespaces.Well, something must be wrong, since it is not working.. so to try to
help you, we need a sample XML that your xslt script runs on.
I have another question in XSLT. How can i initialize a varible inside oneYou can't. In XSLT, a variable can only be assigned a value once. You
scope and use that variable in another scope?
can declare and assign to it and use it in a child scope, but not
anywhere else.
In java or c, we can declare a variable out side of both scope, thenYes, well.. java and c aren't functional programming languages :-)
initialize it inside one scope. now variable will be available to use in
another scope with in same class.
I tried the following however it didnt work.Well... your example is probably simplified, so I might just be wrong
<xsl:variable name="x"/>
<Header>
<ID> <xsl:value-of select="......"></ID>
<xsl:variable name="x" select = "........."/>
</Header>
<Detail>
<HD><xsl:value-of select="$x"/></HD>
</Detail>
here, but since you are in the same node in your header and detail
records in this example, you can access whatever in the detail section
exactly the same way you accessed it in the header section. So no need
to save it in a variable and use that later on.
--
eliasen, representing himself and not the company he works for.
Private blog: http://blog.eliasen.dk
Private email: jan@xxxxxxxxxx
.
- References:
- Re: how XSLT grouping works?
- From: Jan Eliasen
- Re: how XSLT grouping works?
- Prev by Date: How to split flat file into separate messages?
- Next by Date: RE: How to split flat file into separate messages?
- Previous by thread: Re: how XSLT grouping works?
- Next by thread: RE: How to set the value of an envelope element?
- Index(es):
Relevant Pages
|