|
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
|
|
|
February 24th, 2007, 12:44 AM
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 &#10; in the input string then script is working fine...but if the structure does't specify any &#10; for next line it is not working....how to solve this problem...anybody pls help..
|
February 24th, 2007, 06:01 AM
|
|
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
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
|
February 26th, 2007, 12:37 AM
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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("","Query Statement","
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 ")">
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("","Query Statement"," 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")">
and everything working fine...
how to make my input in this format in xsl 1.0..pls help
|
February 26th, 2007, 02:54 AM
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 &#10; in the result string that why i'm not getting line structure in output html ..every thing is comming in one line
|
February 26th, 2007, 03:45 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
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)
|
February 26th, 2007, 04:39 AM
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i did't get u..can u pls explain more..
|
|
|