Hello again.
I'v got my system to work, but there is one little problem - it usese
(apache) too many memory and load jumps (with 10-15 clicks) to 2.8 etc.
Before i do not had this kind of a problem.
So wat i did:
As i use 4 templaes defined in the same file where all of the code
inside the template must access variables wich values came from outside
of the xsl (from form submit or query).
So as i can't you XSL params with XSL api because it's can't determine
the encoding of the values and instead on ��� chars some weird ones
occoured.
Then i put my variables to little XML file and gave it to Sablot. But i
can not access document variables and give selected values to the global
parameters at the top of the XSL. So what i did: I defined in every
template all the needed parameters and vhen i called the template - i
used with-params option to pass values from current template to the next.
The total amount of params is 10-12 and template including is flat - no
recursive templates.
So why suddenly sablot needs to use so many memory????
Martin Pedak wrote:
>
> I answer myself.
>
> You must define at first in template all your parameters what you like
> to pass with "with-param" and then it works fine.
>
> I will go now to play with my xsl...
>
> Martin Pedak wrote:
>
>>
>> Ok, that i knew before, but this method is not very good.
>>
>> Could it be done somehow like this that i define toplevel variables
>> vith values from document() function or can i somehow use
>> <xsl:with-param> ?
>>
>>
>> I tried to work with with-param but how it works ? Whenever i passed
>> new value with with-param to the variable, in template always the
>> toplevel parameter value occoured... ?
>>
>> Pavel Hlavnicka wrote:
>>
>>>
>>> This way eliminates the global variables - it uses the document()
>>> function istead.
>>>
>>> Suppose you use two variables foo a bar, create small xml file vars.xml
>>>
>>> <?xml version='1.0' encoding='iso-8859-6'?>
>>> <vars>
>>> <foo>foo value</foo>
>>> <bar>bar value</bar>
>>> </vars>
>>>
>>> If you use file uri's in your templates, you may address you
>>> 'variables' as document("vars.xml")/vars/foo etc. Yes, of course,
>>> it's quite verbose method, but it works. :)
>>>
>>> If you are using the AIP (C or Perl), you may use the named buffers
>>> as well.
>>> Pavel
>>>
>>> Martin Pedak wrote:
>>>
>>>> Can and how can i deine toplevel variables with this kind of method
>>>> - using one small xml file.
>>>>
>>>> I maked dynamic xml file with variables and values but how can i now
>>>> define xsl variable values, wich i use inside of all my templates?
>>>>
>>>> Pavel Hlavnicka wrote:
>>>>
>>>>>
>>>>> There is no way, how to determine the encoding of the passed-in
>>>>> string value. There are some heristic methods, but generally (and
>>>>> especialy for shorter strings) it is not possible to guess the
>>>>> encoding.
>>>>>
>>>>> You have to recode your values yourself. we're planning to publish
>>>>> internal recoding functions used in the core engine, this should
>>>>> make your life easier.
>>>>>
>>>>> Perhaps we could extend the API with a call like SablotAddParamEnc,
>>>>> which could take a encoding identifier as additional parameter.
>>>>>
>>>>> Other way is to put all your params in one small XML file of any
>>>>> necoding and use the document function to access them (as Petere
>>>>> suggested in his message).
>>>>>
>>>>> Pavel
>>>>>
>>>>> Martin Pedak wrote:
>>>>>
>>>>>> That was i affraid of. And if the encoding is other than utf-8, if
>>>>>> the encoding is like iso-8859-1 and i pass values like "����" then
>>>>>> i get some weird chars, right ?
>>>>>>
>>>>>> So what is needed is that chars must be convertet to the utf-8 if
>>>>>> it is not. Can you use iconv for this? Determine at first, in wich
>>>>>> encoding string is and then encode it to utf-8 ?
>>>>>>
>>>>>> Pavel Hlavnicka wrote:
>>>>>>
>>>>>>>
>>>>>>> utf-8
>>>>>>>
>>>>>>> sorry for the delay. Generally there is no other choice, I guess.
>>>>>>> The first idea I had after reading your mail was, that parameter
>>>>>>> could be processed in the same encoding as the stylesheed it is
>>>>>>> refered from, but xsl:include disallows this approach.
>>>>>>>
>>>>>>> Pavel
>>>>>>>
>>>>>>> Martin Pedak wrote:
>>>>>>>
>>>>>>>> Hi.
>>>>>>>>
>>>>>>>> I posted some weeks ago one question where i asked about
>>>>>>>> encodings of the parameters, but nobody answered...
>>>>>>>>
>>>>>>>> So question remains. In wich encoding sablotron reads parameters
>>>>>>>> & parameter values?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
--
-------------------
Martin Pedak
O� Webmedia
Tel: +372 7 441583
GSM: +372 50 68531