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

Re: variable ending with ^@

Subject: Re: variable ending with ^@
From: himanshu padmanabhi <himanshu.padmanabhi@xxxxxxxxx>
Date: Sat, 21 Feb 2009 11:51:19 +0530
Re:  variable ending with ^@
Continue from previous mail..

 and this is the corresponding part of XSL file
 <CODE>
 <xsl:template match="MODULE_NAME">
    <form name="form1" method="POST" action="logic_file.cgi">
     <tr><td><input value="{$sidx}" type="hidden" name="sidx"></input>
     </td></tr>
    </form>
  </xsl:template>
 </CODE>

on form submit on this XSL file under some flag condition,here's my logic file
<CODE>
  logic code in perl
 &redirect(abc.cgi?idx=$in{'idx'}&done=1); //done=1 indicating logic
file executed
</CODE>

uptil here "idx" contains only value with no ^@.

in abc.cgi when I hit "Create",it goes to part of its code
<CODE>
if($in{'create'}) {
   chomp($in{'idx'});
   print $in{'idx'};
}
</CODE>
Here I am getting value appended with ^@.


On Sat, Feb 21, 2009 at 11:43 AM, himanshu padmanabhi
<himanshu.padmanabhi@xxxxxxxxx> wrote:
> Sorry all,the code is in perl.
>
> "abc.cgi"  has $in{'idx'}.
>
> concerned part of code
> <CODE>
> print "<form action=abc.cgi method=post name=abc>\n";
> print "<input type=hidden name=idx value='$in{'idx'}'>\n";
> print "</form>
> </CODE>
>
> on some JavaScript event,form.submit calls the same file,this part of code
> <CODE>
>   my $parser = XML::LibXML->new();
>    my $xslt = XML::LibXSLT->new();
>
>    my $source = $parser->parse_file($xmlfile);
>    my $style_doc = $parser->parse_file($xslfile);
>
>    my $stylesheet = $xslt->parse_stylesheet($style_doc);
>
>    if($in{'some_var'}) {
>        my $results = $stylesheet->transform($source, idx => "''");
>        print $stylesheet->output_string($results);
>    }else{
>        my $results = $stylesheet->transform($source,idx => "'$in{'idx'}'");
>        print $stylesheet->output_string($results);
>   }
> </CODE>
>
> and this is the corresponding part of XSL file
> <CODE>
> <xsl:template match="MODULE_NAME">
>    <form name="form1" method="POST" action="logic_file.cgi">
>     <tr><td><input value="{$sidx}" type="hidden" name="sidx"></input>
>
>
> </CODE>
>
>
> On Sat, Feb 21, 2009 at 3:19 AM, C. M. Sperberg-McQueen
> <cmsmcq@xxxxxxxxxxxxxxxxx> wrote:
>>
>> On 20 Feb 2009, at 09:10 , Michael Kay wrote:
>>
>>> I don't know the answer, and I suspect no-one else does either. You
>>> haven't
>>> given enough information. It's not even clear what programming language
>>> each
>>> of these code fragments represents. Certainly, the "^@" is coming from a
>>> place that you haven't told us about.
>>>
>>> Michael Kay
>>> http://www.saxonica.com/
>>>
>>>> -----Original Message-----
>>>> From: himanshu padmanabhi [mailto:himanshu.padmanabhi@xxxxxxxxx]
>>>> Sent: 19 February 2009 13:26
>>>> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>>>> Subject:  variable ending with ^@
>>>>
>>>> Code flow
>>>>
>>>>
>>>>
>>>> abc.cgi->abc.cgi on form .submit->abc.xsl on form submit->xyz.cgi
>>>> redirect->abc.cgi
>>>>
>>>> "abc.xsl" passes value to next form like "<input value="{$idx}"
>>>> type="hidden" name="idx"></input>" as suggested here.
>>>>
>>>> I am getting value of $in{'idx'} in final abc.cgi in above
>>>> cycle.But getting its value as "idx=14^@".
>>>>
>>>> what is this "^@".I tried with chomp,chop.It still remains.
>>>>
>>
>> The string "^@" is a common way to make visible the control
>> character NUL.
>>
>> If I had to guess, I'd guess that some program in your tool
>> chain is miscalculating a string length somewhere, or inserting
>> a UTF16 character from page 00 of Unicode, in a place where the
>> consumer of the data is expecting UTF8 or some eight-bit
>> character set.  (The 00 octet will look to an eight-bit
>> application like a NUL character.)
>>
>> I hope this helps.  (But Michael Kay is quite right:  it will
>> help you get better answers if you provide better information
>> about the problem.)
>>
>>
>> Michael Sperberg-McQueen
>>
>>
>> --
>> ****************************************************************
>> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC
>> * http://www.blackmesatech.com
>> * http://cmsmcq.com/mib
>> * http://balisage.net
>> ****************************************************************
>>
>>
>
>
>
> --
> Regards,
> Himanshu Padmanabhi
>



-- 
Regards,
Himanshu Padmanabhi

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.