Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 24th, 2007, 12:44 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default space is not working..

in my xslt i'm passing some nove value to a java script function..like this..
<xsl:element name="input">
                            <xsl:attribute name="type">button</xsl:attribute>
                             <xsl:attribute name="class">nodevalue</xsl:attribute>
                             <xsl:attribute name="value">Statement...</xsl:attribute>
                             <xsl:attribute name="name">Statement</xsl:attribute>
                             <xsl:attribute name="onclick">callPopupWindow("DataSource","Query Statement","<xsl:value-of select="select"/>")</xsl:attribute>
                            </xsl:element>


and my passing value is select c.dept_name, a.transaction_no, a.transaction_date, f.store_name,
          d.item_description, e.unit_description, b.qty, b.sales_price, b.qty*b.sales_price value
from transaction_header_tab a, transaction_detail_tab b, department_tab c,
          item_master_tab d, unit_master_tab e, store_master_tab f

if next line is define by &amp;#10; in the input string then script is working fine...but if the structure does't specify any &amp;#10; for next line it is not working....how to solve this problem...anybody pls help..
 
Old February 24th, 2007, 06:01 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

To debug such problems, it's essential to view the HTML that you're generating (as HTML, not as rendered in the browser). Show us the input document with and without the newline, and show us the HTML code that's generated in the two cases.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 26th, 2007, 12:37 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

when my xml structure is...
Code:
<select>
<![CDATA[
select c.dept_name, a.transaction_no, a.transaction_date, f.store_name,
          d.item_description, e.unit_description, b.qty, b.sales_price, b.qty*b.sales_price  value
from    transaction_header_tab a, transaction_detail_tab b, department_tab c,
          item_master_tab d, unit_master_tab e, store_master_tab f
where  a.transaction_date >= :p_start_date and
           a.transaction_date <= :p_end_date and
           a.transaction_type = 'I' and
           a.destination_store_code = c.dept_code and
           a.store_code = f.store_code and
           a.transaction_no = b.transaction_no and
           a.transaction_type = b.transaction_type and
           b.item_code = d.item_code and
           d.iuom = e.unit_code
order by c.dept_name, a.transaction_no]]>
</select>
my output is ...
Code:
<input type="button" class="nodevalue" value="Statement..." name="Statement" onclick="callPopupWindow(&quot;&quot;,&quot;Query Statement&quot;,&quot; 
      select c.dept_name, a.transaction_no, a.transaction_date, f.store_name,
          d.item_description, e.unit_description, b.qty, b.sales_price, b.qty*b.sales_price  value
from    transaction_header_tab a, transaction_detail_tab b, department_tab c,
          item_master_tab d, unit_master_tab e, store_master_tab f
where  a.transaction_date >= :p_start_date and
           a.transaction_date <= :p_end_date and
           a.transaction_type = 'I' and
           a.destination_store_code = c.dept_code and
           a.store_code = f.store_code and
           a.transaction_no = b.transaction_no and
           a.transaction_type = b.transaction_type and
           b.item_code = d.item_code and
           d.iuom = e.unit_code
order by c.dept_name, a.transaction_no      &quot;)">
and it can't call the script method...

but if my input is in one line and every new line starting is indicating by #10;(no space before it)..like this..

Code:
 <select><![CDATA[select c.dept_name, a.transaction_no, a.transaction_date, f.store_name,#10;d.item_description, e.unit_description, b.qty, b.sales_price, b.qty*b.sales_price  value#10;from    transaction_header_tab a, transaction_detail_tab b, department_tab c,#10;item_master_tab d, unit_master_tab e, store_master_tab f#10;where  a.transaction_date >= :p_start_date and#10;a.transaction_date <= :p_end_date and#10;a.transaction_type = 'I' and#10;a.destination_store_code = c.dept_code and#10;a.store_code = f.store_code and#10;a.transaction_no = b.transaction_no and#10;a.transaction_type = b.transaction_type and#10;b.item_code = d.item_code and#10; d.iuom = e.unit_code#10;order by c.dept_name, a.transaction_no]]></select>
the output html is...

Code:
<input type="button" class="nodevalue" value="Statement..." name="Statement" onclick="callPopupWindow(&quot;&quot;,&quot;Query Statement&quot;,&quot; select c.dept_name, a.transaction_no, a.transaction_date, f.store_name,&amp;#10;d.item_description, e.unit_description, b.qty, b.sales_price, b.qty*b.sales_price  value&amp;#10;from    transaction_header_tab a, transaction_detail_tab b, department_tab c,&amp;#10;item_master_tab d, unit_master_tab e, store_master_tab f&amp;#10;where  a.transaction_date >= :p_start_date and&amp;#10;a.transaction_date <= :p_end_date and&amp;#10;a.transaction_type = 'I' and&amp;#10;a.destination_store_code = c.dept_code and&amp;#10;a.store_code = f.store_code and&amp;#10;a.transaction_no = b.transaction_no and&amp;#10;a.transaction_type = b.transaction_type and&amp;#10;b.item_code = d.item_code and&amp;#10; d.iuom = e.unit_code&amp;#10;order by c.dept_name, a.transaction_no&quot;)">
and everything working fine...
how to make my input in this format in xsl 1.0..pls help
 
Old February 26th, 2007, 02:54 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i thik i have to use normalize-space() ..and it is working for some cases but if the input is like that...

Code:
#10; P_FIELD_LEVEL IN BOOLEAN) IS /* Is the trigger item level? */#10;/* Validate foreign key value/query lookup data. */#10;BEGIN#10; DECLARE#10; CURSOR C IS#10; SELECT PMU.PMU_BEZEICHNUNG#10; FROM PRAEMIENMODULE PMU#10; WHERE PMU.PMU_ID = :TAR.TAR_PMU_ID;#10; BEGIN#10; OPEN C;#10; FETCH C#10; INTO :TAR.DSP_PMU_BEZEICHNUNG;#10; IF C%NOTFOUND THEN#10; RAISE NO_DATA_FOUND;#10; END IF;#10; CLOSE C;#10; EXCEPTION#10; WHEN OTHERS THEN#10; CGTE$OTHER_EXCEPTIONS;#10; END;#10;END;#10;"
it is showing out put html as
Code:
PROCEDURE CGFK$CHK_TAR_TAR_PMU( P_FIELD_LEVEL IN BOOLEAN) IS /* Is the trigger item level? */ /* Validate foreign key value/query lookup data. */ BEGIN DECLARE CURSOR C IS SELECT PMU.PMU_BEZEICHNUNG FROM PRAEMIENMODULE PMU WHERE PMU.PMU_ID = :TAR.TAR_PMU_ID; BEGIN OPEN C; FETCH C INTO :TAR.DSP_PMU_BEZEICHNUNG; IF C%NOTFOUND THEN RAISE NO_DATA_FOUND; END IF; CLOSE C; EXCEPTION WHEN OTHERS THEN CGTE$OTHER_EXCEPTIONS; END; END;
missing &amp;#10; in the result string that why i'm not getting line structure in output html ..every thing is comming in one line

 
Old February 26th, 2007, 03:45 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You're better off storing the data for the popup window in a hidden textbox rather than have it as part of an attribute value.

--

Joe (Microsoft MVP - XML)
 
Old February 26th, 2007, 04:39 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i did't get u..can u pls explain more..






Similar Threads
Thread Thread Starter Forum Replies Last Post
Strangely working XSLT function normalize-space() seetaramayya XSLT 2 April 23rd, 2007 06:26 AM
Looks like a space but it isn't. rstelma SQL Server 2000 3 September 7th, 2005 07:17 PM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM
space crmpicco Javascript How-To 1 February 7th, 2005 01:26 PM
Normalize-space() not working AForgue XSLT 4 December 5th, 2003 12:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.