How to Use Switch Statement with Exclusion Group (radio buttons)?
Wouldn't you know, just when I though I'd really be making progress, I've come across another problem I can't solve. In a homeowners insurance application I am building, there is an exclusion group that needs to set the value of several variables
I have setup in the form properties/variables. These variables take on different values depending on the users choice. For the exclusion group, in the object pallet, I have set the binding to normal, and have checked the "Specify Item Values" check box. Also the values for the choices have been assigned 1,2,3,4,5.
Here is my code for the change event fir the exclusion group (This is exactly what I have tried). For now, the values for the variables to take on in the different cases, are completely arbitrary.
switch (this.change.rawValue) // I have tried so many things here
case "1": // I have tried the caption, single quotes in all combinations
addLivingExp = "1";
damageOthersProperty = "2";
liabilityIncl = "3";
maxCoverage = "4";
minCoverage = "5";
persProperty = "6";
relatedPrivateStruct = "7";
break;
case "2":
addLivingExp = "10";
damageOthersProperty = "20";
liabilityIncl = "30";
maxCoverage = "40";
minCoverage = "50";
persProperty = "60"
relatedPrivateStruct = "70";
break;
case "3":
addLivingExp = "100";
damageOthersProperty = "200";
liabilityIncl = "300";
maxCoverage = "400";
minCoverage = "500";
persProperty = "600"
relatedPrivateStruct = "700";
break;
case "4":
addLivingExp = "1000";
damageOthersProperty = "2000";
liabilityIncl = "3000";
maxCoverage = "4000";
minCoverage = "5000";
persProperty = "6000"
relatedPrivateStruct = "7000";
break;
case "5":
addLivingExp = "10000";
damageOthersProperty = "20000";
liabilityIncl = "30000";
maxCoverage = "40000";
minCoverage = "50000";
persProperty = "60000"
relatedPrivateStruct = "70000";
break;
default:
minCoverage= 5;
break;
There must be something obvious I am missing? Eternally grateful for advice on this.
Stephen
There are two issues in this script:
1. You are not using the accessor 'value' to set form variables
2. You are not correctly getting the value of the radio button list in the switch clause
Please see the working script below.
Ben Walsh
www.avoka.com
switch (this.rawValue)
case "1":
addLivingExp.value = "1";
damageOthersProperty.value = "2";
liabilityIncl.value = "3";
maxCoverage.value = "4";
minCoverage.value = "5";
persProperty.value = "6";
relatedPrivateStruct.value = "7";
break;
case "2":
addLivingExp.value = "10";
damageOthersProperty.value = "20";
liabilityIncl.value = "30";
maxCoverage.value = "40";
minCoverage.value = "50";
persProperty.value = "60"
relatedPrivateStruct.value = "70";
break;
case "3":
addLivingExp.value = "100";
damageOthersProperty.value = "200";
liabilityIncl.value = "300";
maxCoverage.value = "400";
minCoverage.value = "500";
persProperty.value = "600"
relatedPrivateStruct.value = "700";
break;
case "4":
addLivingExp.value = "1000";
damageOthersProperty.value = "2000";
liabilityIncl.value = "3000";
maxCoverage.value = "4000";
minCoverage.value = "5000";
persProperty.value = "6000"
relatedPrivateStruct.value = "7000";
break;
case "5":
addLivingExp.value = "10000";
damageOthersProperty.value = "20000";
liabilityIncl.value = "30000";
maxCoverage.value = "40000";
minCoverage.value = "50000";
persProperty.value = "60000"
relatedPrivateStruct.value = "70000";
break;
default:
minCoverage.value = 5;
break;
Similar Messages
-
How to use union statement with declare & set function?
Hi Experts,
i have small query about how to use union statement with declare & set function?
Example as below :
DECLARE @name AS date
Declare @name2 AS date
/* SELECT FROM [2013].[dbo].[OINV] T0 */
/* WHERE */
SET @name = /* T0.DocDate */ '[%1]'
SET @name2 = /* T0.DocDate */ '[%2]'
select '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2013.dbo.orct t1
inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2013.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]
Union
/* SELECT FROM [2014].[dbo].[OINV] T0 */
/* WHERE */
SET @name = /* T0.DocDate */ '[%1]'
SET @name2 = /* T0.DocDate */ '[%2]'
select '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2014.dbo.orct t1
inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2014.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]You have to create stored procedure in SQL only .
Like u must have create for Crystal .
You can execute procedure in query manager but you have to enter parameter manually..
example
Exec @Test '20140101' '20140501'
Every time user has to enter it manually in yyyymmdd format in case of date parameters.
Example
Create Proc [@Test]
as begin
DECLARE @name AS date
Declare @name2 AS date
/* SELECT FROM [2013].[dbo].[OINV] T0 */
/* WHERE */
select '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2013.dbo.orct t1
inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2013.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between @Name and @Name2
Union
/* SELECT FROM [2014].[dbo].[OINV] T0 */
/* WHERE */
select '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2014.dbo.orct t1
inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2014.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between
between @Name and @Name2
end -
How to use " PERFORM ", STATEMENT WITH OFFSET
hI,
How we use Perform statement with offset, like
Example: " PERFORM READ_SEGRELEASE USING INT_EDIDC+11."
My requirement is to use Perform with Automatic length declaration.
Automatic length declaration in PERFORM statement
Kindly Explain and Provide some Example programm written in this situation.
Thanks,
P.N.KumarHiere is an example of what you probably require:
DATA:
lv_offset TYPE syoffi,
lv_length TYPE flength,
lv_field TYPE string.
lv_field = 'This is my value: hello world'.
lv_length = 5.
lv_offset = 18.
PERFORM read_segrelease USING lv_field
lv_length
lv_offset.
*& Form READ_SEGRELEASE
* text
* -->P_LV_FIELD text
* -->P_LV_LENGTH text
* -->P_LV_OFFSET text
FORM read_segrelease USING p_lv_field TYPE string
p_lv_length TYPE flength
p_lv_offset TYPE syoffi.
DATA:
lv_result TYPE string.
lv_result = p_lv_field+p_lv_offset(p_lv_length).
WRITE: / lv_result.
ENDFORM. " READ_SEGRELEASE -
How to use parameterized statements with labSQL?
Hi everybody,
I have a big problem with labSQL. Every statement or query I have to use in my program works correctly, but I have a performance problem when writing my data to the database. The problem is the handling of the SQL statements by the DB. The solution will be the use of parameterized statements with labSQL.
The manual for NI Labview Database Connectivity Toolkit provides such information, but there are large differences to labSQL, and I don't get the clue. Is anybody able and would be so kind to help me? If someone has an example for using parameterized SQL statements with labSQL or the ADO methods for such stuff, please be so kind to share it with me.
Thank you for reading all of this
Best regards,
MatthiasThank you very much for your help. I already had set up the correct SQL statement and created the parameters but got errors when executing the command object. After some tries I found that neither the SQL statement nor the parameters were the source of the error, as I had expected first.
The problem was that I was sending the wrong data type to the execute method of the command object. It expected some variant input for the parameters. I send an array of strings, which caused an error. I casted that array to variant with the same result. But a single string to variant worked well (with only one parameter in the SQL statement). The easy solution was to cast all strings to variants, and then build an array out of them. The execute method worked with that. Now the transaction is 4 times faster than before
Thanks again!
Edit:
If someone is interested in some example VI, please let me know. I should have some time next week to build one.
Message Edited by manicnobody on 02-26-2009 10:19 AM -
How to use switch statement in JSP?
Hi,
I am using switch satement in jsp.
the code as follows:
switch(flag)
case 1: query="select * from cust";
break;
case 2: query="select * from cust where minp="+mini+"and maxp="+maxi;
break;
default: query="";
out.println(query);but, i am getting some number format exception. I don't know where i am going wrong.
Please help
Regards,
AshviniI got the solution
Thanks anyways
Regards,
AShvini -
How to use Spry validation with link styled submit buttons..??
I'm working with a theme package that comes with a bunch of button styles that work with basic links. For example:
<a href='page.html' class='small-button smallblue'><span>Button Label</span></a>
I've got a basic form setup with Spry validation, but the submit button needs some styling to make it look nice with the site. Since there are already styles ready for me to turn links into buttons I figured I'd use the same thing for my submit buttons.
To accomplish that, I'm using the following javascript...
<script type="text/javascript">
function submitForm() {
document.getElementById("form_name").submit();
</script>
And then I'm updating my submit button to something like this...
<a href='javascript: submitForm()' class='small-button smallblue'><span>Button Label</span></a>
When I do this, the form submits as expected, but the Spry validation doesn't work. Is there a way I can make the Spry stuff work with these types of buttons? I know I could create separate styles for the submit buttons themselves, or I could use an image type button, but I'd really like to figure out how to get these existing styles to work for me since the theme already has so many of them done for me.
Any information on this would be greatly appreciated. Thanks!Save yourself a lot of trouble and style the normal submit button as per
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<style>
.Standout {
font-family: Geneva, Arial, Helvetica, sans-serif;
text-transform: uppercase;
color: #FFFFFF;
font-size: 16px;
background-color: #CC0000;
font-weight: bold;
border-style: none;
padding-top: 6px;
padding-bottom: 5px;
padding-right: 64px;
padding-left: 64px;
letter-spacing: 1px;
.Standout:hover {
background-color: #000000;
</style>
</head>
<body>
<form action="" method="get" name="myform">
<span id="sprytextfield1">
<label for="text1"></label>
<input type="text" name="text1" id="text1">
<span class="textfieldRequiredMsg">A value is required.</span></span>
<input name="input" type="submit" class="Standout">
</form>
<script>
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]});
</script>
</body>
</html>
Gramps -
How to use prepared statements with a single id
Here is the code I am having trouble with:
String sqlb = "INSERT INTO books.book(title)" +
"VALUES(?)";
String sqla = "INSERT INTO books.author(name,date_of_birth)" +
"VALUES(?,?)";
PreparedStatement psb = c.prepareStatement(sqlb);
PreparedStatement psa = c.prepareStatement(sqla);
psb.setString(1,book.getTitle());
psa.setString(1,author.getName());
psa.setString(2,author.getDate());
m = psb.executeUpdate();
n = psa.executeUpdate();
After placing two book/Author objects into the database I get a table that looks something like this:
0 AGreatBook Joe Bloggs 08-10-83
1 BGreatBook Joe Bloggs 08-10-83
2 AGreatBook John Smith 12-12-65
3 BGreatBook JohnSmith 12-12-65
Clearly this is not correct I want this:
0 AGreatBook Joe Bloggs 08-10-83
1 BGreatBook John Smith 12-12-65
By the way I have placed a foreign key in book table
Anyone know how to do this? (I am using postgres)
regardshttp://forum.java.sun.com/thread.jspa?threadID=726820&tstart=0
http://forum.java.sun.com/thread.jspa?threadID=726823&tstart=0 -
How to avoid data repetation when using select statements with innerjoin
how to avoid data repetation when using select statements with innerjoin.
thanks in advance,
satheeshyou can use a query like this...
SELECT DISTINCT
frg~prc_group1 "Product Group 1
frg~prc_group2 "Product Group 2
frg~prc_group3 "Product Group 3
frg~prc_group4 "Product Group 4
frg~prc_group5 "Product Group 5
prc~product_id "Product ID
txt~short_text "Product Description
UP TO 10 ROWS
INTO TABLE l_i_data
FROM
Joining CRMM_PR_SALESG and
COMM_PR_FRG_ROD
crmm_pr_salesg AS frg
INNER JOIN comm_pr_frg_rod AS prd
ON frgfrg_guid = prdfragment_guid
Joining COMM_PRODUCT and
COMM_PR_FRG_ROD
INNER JOIN comm_product AS prc
ON prdproduct_guid = prcproduct_guid
Joining COMM_PRSHTEXT and
COMM_PR_FRG_ROD
INNER JOIN comm_prshtext AS txt
ON prdproduct_guid = txtproduct_guid
WHERE frg~prc_group1 IN r_zprc_group1
AND frg~prc_group2 IN r_zprc_group2
AND frg~prc_group3 IN r_zprc_group3
AND frg~prc_group4 IN r_zprc_group4
AND frg~prc_group5 IN r_zprc_group5.
reward it it helps
Edited by: Apan Kumar Motilal on Jun 24, 2008 1:57 PM -
How to use perform statements in sap scripts
how to use perform statements in sap scripts . and pls send me one progam for this
thnaks
rajaHi Raja,
<b>PERFORM</b> key work is used to include subroutine in sapscript form...
But the processing is lttle bit different form the one we use in ABAP.
Here the paramters passed to form is stored in internal table of name-value table. there are two table one for inbound parameter and other for outbound parameters.
Check out the example below to see how this is used..
<b>Definition in the SAPscript form:</b>
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
<b>Coding of the calling ABAP program:</b>
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY PAGE.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY NEXTPAGE.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE OUT_PAR WITH KEY BARCODE.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = |. "First page
ELSE.
OUT_PAR-VALUE = ||. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = L. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Hope this is clear to understand...
Enjoy SAP.
Pankaj Singh. -
Using Switch Excequtive with NI TestStand
Hello
I am beginner in NI teststand & NI switch excequtive.
I have NI SCXI-1001 Chassis with NI SCXI-1130 switching slots.
I need a quick help on how to use switching in NI TestStand. What I am going to do is: generating a signal by a RIGOL Function Generator and switch this signal to excite some piezoelectric sensors and reading the response signals by a Tektronix oscilloscope.
I have read these documents:
NI TestStand 4.0 Quick Start Guide
Getting Started with TestStand
GETTING STARTED GUIDE NI Switch Executive
and so on
But still, I can not switch the signals with my hardware.
Is there any Tutorial to help me in doing my work?
Is there any VI code, NI TestStand Sequence or Example which can help me?
Please help me asap
Thanks in advance,
MohammadHi Mohammad,
The following are a few documents that outline various ways (including with the Switch Executive) to incorporate switches into your TestStand sequence:
http://zone.ni.com/reference/en-XX/help/370404G-01/nise/teststand/
http://www.ni.com/white-paper/10092/en/
Let us know if those are helpful and keep us updated on your progress!
Regards,
David R
Applications Engineer
National Instruments -
hi everybody,
how to use collect statement to get the total amount paid to different vendor payments
data : begin of wa occurs 0,
bukrs type bsak-bukrs,
lifnr type bsak-lifnr,
land1 type lfa1-land1,
name1 like lfa1-name1,
dmbtr like bsak-dmbtr,
count type i value 0,
tot_vend type i,
vend type i.
data :end of wa.
data : itab like table of wa.
select distinct bukrs lifnr waers from bsak into
corresponding fields of wa
where bukrs in s_bukrs
and lifnr in s_lifnr
and bschl in s_bschl.
i want the total amount paid according to vendor i am using this way but i am not getting
loop at itab into wa.
wa-dmbtr = bsak-dmbtr.
collect wa-dmbtr into itab.
modify itab from wa transporting dmbtr.
i am unalbe to get it
can anybody help me regarding this if possible with example.
thanks in advance,
regards,
venu.Hi Venu,
types: BEGIN OF ty,
NAME(20),
SALES TYPE I,
END OF ty.
data : itab type standard table of ty,
itab1 type standard table of ty,
wa type ty,
wa1 type ty.
wa-NAME = 'Duck'. wa-SALES = 10.
append wa to itab.
wa-NAME = 'Tiger'. wa-SALES = 20.
append wa to itab.
wa-NAME = 'Duck'. wa-SALES = 30.
append wa to itab.
loop at itab into wa.
wa1 = wa.
collect wa1 into itab1.
endloop.
loop at itab1 into wa1.
write : / wa1-name , wa1-sales.
endloop.
COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
<b>If, besides its default key fields, the internal table contains number fields (see also ABAP/4 number types ), the contents of these number fields are added together if the internal table already contains an entry with the same key fields.</b>
If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
In the program you mentioned yesterday,I am not able to get the logic since many lines are commented. -
How to use Oracle partitioning with JPA @OneToOne reference?
Hi!
A little bit late in the project we have realized that we need to use Oracle partitioning both for performance and admin of the data. (Partitioning by range (month) and after a year we will move the oldest month of data to an archive db)
We have an object model with an main/root entity "Trans" with @OneToMany and @OneToOne relationships.
How do we use Oracle partitioning on the @OneToOne relationships?
(We'd rather not change the model as we already have millions of rows in the db.)
On the main entity "Trans" we use: partition by range (month) on a date column.
And on all @OneToMany we use: partition by reference (as they have a primary-foreign key relationship).
But for the @OneToOne key for the referenced object, the key is placed in the main/source object as the example below:
@Entity
public class Employee {
@Id
@Column(name="EMP_ID")
private long id;
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="ADDRESS_ID")
private Address address;
EMPLOYEE (table)
EMP_ID FIRSTNAME LASTNAME SALARY ADDRESS_ID
1 Bob Way 50000 6
2 Sarah Smith 60000 7
ADDRESS (table)
ADDRESS_ID STREET CITY PROVINCE COUNTRY P_CODE
6 17 Bank St Ottawa ON Canada K2H7Z5
7 22 Main St Toronto ON Canada L5H2D5
From the Oracle documentation: "Reference partitioning allows the partitioning of two tables related to one another by referential constraints. The partitioning key is resolved through an existing parent-child relationship, enforced by enabled and active primary key and foreign key constraints."
How can we use "partition by reference" on @OneToOne relationsships or are there other solutions?
Thanks for any advice.
/MatsCrospost! How to use Oracle partitioning with JPA @OneToOne reference?
-
How to use my itunes with a new pc
how to use my itunes with a new pc?
These are two possible approaches that will normally work to move an existing library to a new computer.
Method 1
Backup the library with this User Tip.
Deauthorize the old computer if you no longer want to access protected content on it.
Restore the backup to your new computer using the same tool used to back it up.
Keep your backup up-to-date in future.
Method 2
Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.
Both methods should give the new computer a working clone of the library that was on the old one. As far as iTunes is concerned this is still the "home" library for your devices so you shouldn't have any issues with iTunes wanting to erase and reload.
I'd recommend method 1 since it establishes an ongoing backup for your library.
If you have an iOS device that syncs with contact & calendar data on your computer you should migrate this information too. If that isn't possible create a dummy entry of each type in your new profile and iTunes should offer to merge the existing data from the device into the computer, otherwise the danger is that it will wipe the information from the device.
If your media folder has been split out from the main iTunes folder you may need to do some preparatory work to make it easier to move. See make a split library portable.
Should you be in the unfortunate position where you are no longer able to access your original library, or a backup of it, then see Recover your iTunes library from your iPod or iOS device for advice on how to set up your devices with a new library with the maximum preservation of data. If you don't have any Apple devices then see HT2519 - Downloading past purchases from the App Store, iBookstore, and iTunes Store.
tt2 -
How to use the namespace with a parser?
I want to use the namespace in my project. For this reason, I use a sample
from
http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/sax/7b_pe.html
http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/dom/5_ns.html
to test my understanding.
The slideshow2.dtd refer to the definition in 'xhtml.dtd'. Because in these
two files, they all use the 'title' as the element names. To solve these
conflicts, The namespace is used to qualified the one in slideshow2.dtd.
But the parser still complain that the 'title' in slideshow2.dtd is declared
more than once.
I use apache's Xerces.
I want to know if Xereces realy support namespace spec. now, or how to use
the namespace with a parser. Can anyone kindly tell me where to find some
material that demo the use of namespace in Java program.
Thanks for any help!!!
#############FILE: slideshow2.dtd ###############
<?xml version='1.0' encoding='us-ascii'?>
<!ELEMENT slideshow (slide+)>
<!ELEMENT slide (title?, item*)>
<!ENTITY % xhtml SYSTEM "xhtml.dtd">
%xhtml;
<!ELEMENT title (#PCDATA)*>
<!ATTLIST title
xmlns CDATA #FIXED "http://www.example.com/slideshow"
>
<!ELEMENT item (#PCDATA)>
##############FILE: xhtml.dtd #########################
<?xml version='1.0' encoding='us-ascii'?>
<!ELEMENT html (head)>
<!ATTLIST html
xmlns CDATA #FIXED "http://www.example.com/xhtml"
>
<!ELEMENT head (title,style*)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT style (#PCDATA)>
#############FILE: slideshow.xml ####################
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE slideshow SYSTEM "slideshow2.dtd">
<slideshow>
<slide>
<title xmlns="http://www.example.com/slideshow">Wake up to
products!</title>
</slide>
</slideshow>I want to use the namespace in my project. For this reason, I use a sample
from
http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/sax/7b_pe.html
http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/dom/5_ns.html
to test my understanding.
The slideshow2.dtd refer to the definition in 'xhtml.dtd'. Because in these
two files, they all use the 'title' as the element names. To solve these
conflicts, The namespace is used to qualified the one in slideshow2.dtd.
But the parser still complain that the 'title' in slideshow2.dtd is declared
more than once.
I use apache's Xerces.
I want to know if Xereces realy support namespace spec. now, or how to use
the namespace with a parser. Can anyone kindly tell me where to find some
material that demo the use of namespace in Java program.
Thanks for any help!!!
#############FILE: slideshow2.dtd ###############
<?xml version='1.0' encoding='us-ascii'?>
<!ELEMENT slideshow (slide+)>
<!ELEMENT slide (title?, item*)>
<!ENTITY % xhtml SYSTEM "xhtml.dtd">
%xhtml;
<!ELEMENT title (#PCDATA)*>
<!ATTLIST title
xmlns CDATA #FIXED "http://www.example.com/slideshow"
>
<!ELEMENT item (#PCDATA)>
##############FILE: xhtml.dtd #########################
<?xml version='1.0' encoding='us-ascii'?>
<!ELEMENT html (head)>
<!ATTLIST html
xmlns CDATA #FIXED "http://www.example.com/xhtml"
>
<!ELEMENT head (title,style*)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT style (#PCDATA)>
#############FILE: slideshow.xml ####################
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE slideshow SYSTEM "slideshow2.dtd">
<slideshow>
<slide>
<title xmlns="http://www.example.com/slideshow">Wake up to
products!</title>
</slide>
</slideshow> -
How to use Stylesheet (XSL) with JSPX ?
Hi!
How to use XSL stylesheets with JSPX pages?
I want use an xsl transformations with jspx pages, I tried using the following syntax, but it didn't work....
<?xml version='1.0' stylesheet type="text/xsl" href="mathml.xsl" encoding='UTF-8'?>
<tr:html xmlns="http://www.w3.org/1999/xhtml">
what is the best way to use xslt with jspx pages?
Thanking you in advance,
SambaThanks Ric,
But My problem is not solved..
I'm getting the transformation working in plain HTML
The file given below :
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?>
<!--
Copyright David Carlisle 2001, 2002.
Use and distribution of this code are permitted under the terms of the <a
href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
W3C Software Notice and License</a>.-->
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head>
<title>Content MathML Examples</title>
</head>
<body>
<div style="border-style:solid; border-width:1px; margin: 1em 1em 1em 1em; padding: 1em 1em 1em 1em;color:gold;background:grey;">
<pre><![CDATA[<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<eq/>
<apply>
<abs/>
<ci> x </ci>
</apply>
<piecewise>
<piece>
<apply><minus/><ci> x </ci></apply>
<apply><lt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<cn> 0 </cn>
<apply><eq/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<ci> x </ci>
<apply><gt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
</piecewise>
</apply>
</math>]]>
</pre>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<eq/>
<apply>
<abs/>
<ci> x </ci>
</apply>
<piecewise>
<piece>
<apply><minus/><ci> x </ci></apply>
<apply><lt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<cn> 0 </cn>
<apply><eq/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<ci> x </ci>
<apply><gt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
</piecewise>
</apply>
</math>
</div>
</body>
</html>But the same thing is not working when put in jspx page..
And I tried to use JSTL as you have suggested :
But the content is not getting transformed.
Here is the jspx page :
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:x="http://java.sun.com/jsp/jstl/xml"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:xh="http://www.w3.org/1999/xhtml">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document binding="#{backing_xsltTest.document1}" id="document1">
<div style="border-style:solid; border-width:1px; margin: 1em 1em 1em 1em; padding: 1em 1em 1em 1em;color:gold;background:grey;">
<f:verbatim>
<pre><![CDATA[<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<eq/>
<apply>
<abs/>
<ci> x </ci>
</apply>
<piecewise>
<piece>
<apply><minus/><ci> x </ci></apply>
<apply><lt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<cn> 0 </cn>
<apply><eq/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<ci> x </ci>
<apply><gt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
</piecewise>
</apply>
</math>]]>
</pre>
</f:verbatim>
<c:import var ="mathml" url="/mathml.xsl"/>
<x:transform xslt="${mathml}">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<eq/>
<apply>
<abs/>
<ci> x </ci>
</apply>
<piecewise>
<piece>
<apply><minus/><ci> x </ci></apply>
<apply><lt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<cn> 0 </cn>
<apply><eq/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<ci> x </ci>
<apply><gt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
</piecewise>
</apply>
</math>
</x:transform>
</div>
<af:form binding="#{backing_xsltTest.form1}" id="form1">
</af:form>
</af:document>
</f:view>
<!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_xsltTest-->
</jsp:root>Can you please suggest where I'm doing wrong?
Thanking you in advance,
Samba
Maybe you are looking for
-
Arabic Language compatability- Will XI accept Arabic accept arabic language
Hi, I just wanted to know whether XI is compatible with Arabic langauge.I mean , if a message comes in XI which has Arabic text in some fields ,then will XI process this Arabic languae and send the same arabic text to the traget system.I found some t
-
Mac computers - FF 29.0 and 30.0 does not display the video layer in the Revolution Slider section of WordPress site. Why? We prepared simple Word Press web site. We used a Revolution slider plugin with HTML5 video layer. It works properly on Chrome,
-
Can the screen on my i phone 4s be replaced
Can the I phone 4s screen be replaced, I have contacted Apple who say it cannot be replaced because of the technicality of the phone, apparently they will replace/give me a whole new phone for £139.99 upon attending a 'genius' appointment? Just a bit
-
"Windows Diagnostic detected a S.M.A.R.T fault on disc"
Hi I re-installed Windows 8.1 on my Lenovo Yoga 2 Pro and since then, every logon I get the error message: Windows detected a hard disk problem when I go to the event viewer I see the error: "Windows Diagnostic detected a S.M.A.R.T fault on disc SAM
-
Webdynpro and adobe interactive form
Hi Experts, I have a requirement where i have to develop an interactive adobe form using webdynpro. In the layout of a view , i created an element of type "Interactive form" and do the necessary setting. In the properties of "Interactive form" i hav