How can i generate AMI line codes in LabView signal express?
i wish to conduct a project that uses AMI line codes. but i have a hard time using signal express to generate it. can anyone help me with that?
Hello Barry,
That is really a problem, in LabVIEW, we can only convert vi to the previous version, I have version 7.1 and so I can only convert to version 7.0 and you cannot open this too.
But I think that it's very easy to do what I'm trying to explain you.
Go to the cluster group in the functions pallete. Place an unbundle by name function in the diagram and connect it to the data that's comming out of the FFT Power spectrum vi - the pink (or watever) wire.
Click in the white part of it (it should contain something like f0), choose magnitude.
This is now an array that you can connect to the peak detector function.
Take care about the threshold and width parameters of the peak detector.
Take a look at your signal and decide the amplitude and width of the peaks you want to detect. The threshold is the amplitude above what you consider as a peak, the width is a little bit more complicated - to begin, 3 or 4 should be a good number if you signal is not too noisy - bigger widths will somehow do a kind of a low pass filtering to your signal.
The position output of your peak detector is an array of locations where your peaks were found.
Keep in mind you are now working in frequency domain and that position means something in the frequency domain.
The array you placed as input of the peak detector is an array of points starting in f0 and separated by df (the other elements of the cluster).
So to calculate the real value of the peaks, you have to multiply them by df and add them f0.
Sorry by the big text and sorry if I went too much in detail,
Hope it helps,
Paulo
Similar Messages
-
How can i build a manchester coding in labview signal processing?
how can i build a manchester coding in labview signal processing?
mean to say that how can i digitize my audio input.i waqnt to convert my audio input into manchester coded data format!!!
kindly post related VIs
regards
Solved!
Go to Solution.idma-
Check out the LabVIEW FPGA example http://zone.ni.com/devzone/cda/epd/p/id/6126
Generate Manchester Signal
Basic example showing generation of a Manchester encoded data stream. The data to be sent is generated in one loop and passed to a FPGA FIFO. The subVI which generates the Manchester data stream reads the data bytes form the FIFO and passes them to the digital output. The subVI prepends a simple header to each data packet which allows a reader (see next example) to synchronize and acquire/parse the data. The header consists of a thee half bit pulse followed by a one half bit pulse. The three half bit pulse is not a valid component of regular Manchester encoding and can therefore be differentiated from the rest of the protocol. In addition it can be used by the receiver to to easily measure the bit rate of the protocol. By dividing the length of the three half bit pulse in half (3/4 of a bit), the receiver has a measure to differentiate between full and half bit pulses in the rest of the protocol.
Generate and Read Manchester Signal
An extension of the previous example which adds a Manchester receiver subVI. You must physically wire the digital output channel to your input channel to loop back the data outside the I/O connector of your FPGA R series card or C series module. The Manchester receiver subVI is expecting the data packet to be prepended by a header as explained in the previous section.
I will see if the is a more precise example but this should help
Sam S
Applications Engineer
National Instruments -
How can I generate a staircase waveform in Labview
Hello,
How can a staircase waveform be created in Labview. I have attached the waveform needed.
Ams
Attachments:
staircase.xls 16 KBA waveform typically has a constant time increment between points. Your xls example has two y values for each even timepoint so to reproduce your example directly would be a bit tricky. Attached is one possible very simple solution that has a constant dt.
Modify as needed.
Message Edited by altenbach on 12-17-2006 10:36 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
staircaseII.png 18 KB
staircaseII.vi 14 KB -
How can I generate a map file with LabVIEW?
We wish to use a product which inserts code into our executable to prevent tampering with it by crackers. The program, however, takes the executable file, as well as the map file (which is commonly generated by c++ compilers) and uses the map file to determine where in the exe the critical routines that need protection are at. I can not, however, determine how to create such a map file for a LabVIEW generated executable. Is there a special build option I need to invoke?
Yes, I'm familar with NI's licensing technology, having talked with someone (you, Dennis, I believe) about it before. The problem we have is our software is sold to factories in China where there are no internet connections. We have a physical key 'dongle' which must be present in order for the executable to be willing to run. However, it appears that people are taking the executable which LabVIEW creates and they are editing it, probably by using a a debugger and tracing to the the code which checks for the dongles presence and bypassing it. To my knoweledge, NI's products don't do anything to prevent this, right?
We found a company which sells a product that encryptes, checksums, etc... an executable file, but it needs to know the layout of functions in the exe in order to determine which areas to focus the obfuscation on. They were sort of matter of fact when they said it needs the exe and the map file, as if they expected any language which produced an exe could produce a map file. -
How can I get the time for a simulate signal express vi waveform?
I tried converting to an array and then indexing, but every index I try only gives me the y value. See attached VI for clarification on what I mean.
Attachments:
simulate signal.vi 49 KBYou will have to keep track of that yourself. You are sampling at 360kHz. This means that each sample is ~2.8us. You can easily get the time by taking that dt (2.8us) multiplied by the sample index and adding the time at which the first sample was taken.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
How can i write this C-Code in G-Code
hallo
how can I write this C-Code in LabVIew ,
for a=0; a=<10; a++
for b=0; b=5 ; b+2
X= 3+b;
Y=1+a;
please see the attachment and tell me where is the problem
Attachments:
Unbenannt 11.vi 43 KBWell, at least you tried and got some of it right.
I think this should do what you want, but my C is rusty. Is the increment performed before or after the loop executes? If it's after, then I believe the loop should iterate 11 times, not 10.
In any case, you should note that for a literal translation, you would need to add a sequence structure to guarantee that Y was written to only after the inner loop finished because of the way data-flow works.. Also, note that controls and indicators in LabVIEW are not equivalent to variables. They can be used as such, but they usually should not be.
Another point about this is that you probably want to use the correct data type - the orange terminals are floating point indicators (of double precision, in this case) and you want integers.
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
Try to take over the world!
Attachments:
C.png 4 KB -
How can hide the command line of a t.code in the portal
Dear Experts.
I have the following doubt:
How can hide the Command Line of a Report that is called with a T.Code in the portal?
Attach Image:
[Image T.Code|http://www.freeimagehosting.net/uploads/eab3b6a03c.jpg]
When I created a service using the T.Code SICF for the T.Code , I can hide buttons and the filed command line using
~webgui_simple_toolbar
~singletransaction
~NOHEADEROKCODE
With notes 1010519, "SAP GUI for HTML: Simplified Title Area Without Menu and OK Code" and 959417.
But the problem is that when I create the service in the T.Code SICF, I also have that create an Iview IAC in the portal.
The Question is : How can hide this fields and buttons if I want Publish the T.code using an Iview Transaction in the portal?
In this moment I have used the two options:
1 option) I created a service using the t.Code SICF for my Transaction and I also created an Iview IAC in the portal for call the service.
RESULT:
SAP Web Application Server
500 Connection timed out
Error: -5
Version: 7000
Component: ICM
Date/Time: Sat Jun 12 20:26:39 2010
Module: icxxthr_mt.c
Line: 2698
Server: xyxab...
Error Tag: {-}
Detail: Connection to partner timed out after 60s
2) created an Iview Transaction in the portal and call my transaction.
RESULT.
[Image T.Code|http://www.freeimagehosting.net/uploads/eab3b6a03c.jpg]
But not can hide the field Command Line and other buttons.
I think that the command :
~webgui_simple_toolbar
~singletransaction
~NOHEADEROKCODE
Only can be used if I create a service using the T.Code SICF .
Best Regards
Carmen.Hi Carmen,
The bottom line is that this cannot be done for transaction iviews without modifying the standard webgui service in SICF, which is probably not a good idea (since it affects everyone using SAP GUI for HTML). (You could hack the appintegrator to add the ~webgui_simple_toolbar parameter to the transaction URL template in the portal, but again its not a recommended thing to do ...). Better to create an IAC service in SICF with ~webgui=1 where you set the required appearance using an appropriate value for ~webgui_simple_toolbar, and then create an IAC iview to point at this service.
You can even override the ~transaction value configured in the new service in individual IAC iviews by entering the appropriate value in the application parameter of the iview, for example:
~okcode=/nSU01
And you can pass parameters in the same way:
~okcode=/nSU01 USR02-BNAME=xyz;USREFUS-USERALIAS=abc;
By the way, it would not be recommended to create a URL iview to access an IAC, since you are likely to encounter session management issues in this scenario - better to use an IAC iview.
Regards, Rory -
How can we know the source code no.of lines
hi guys!
please help me, how can we check the source code(No. of lines)in program with out commentshi,
Use this code. Replace with your program name with the text in bold. V_lines gives the no of lines of code excluding comments and as well blank lines.
TYPES: BEGIN OF t_type,
line(72),
END OF t_type.
DATA: program LIKE sy-repid
VALUE <b>'Z_ABC_INNER_JOIN'</b>,
t TYPE STANDARD TABLE OF t_type WITH HEADER LINE.
DATA: v_lines TYPE i.
READ REPORT program INTO t.
IF sy-subrc =0.
LOOP AT t.
IF t+0(1) = '*' OR t IS INITIAL.
DELETE t INDEX sy-tabix.
ENDIF.
ENDLOOP.
DESCRIBE TABLE t LINES v_lines.
ENDIF.
WRITE : v_lines.
Regards,
Sailaja. -
How can i remove a line from an ordinary text file?
It is easy to remove a line from a file by rewriting the file. how can i remove a line without rewriting ? Also, do not use whitespaces to overwrite the line. I expect a perfect line deletion code .....
gimbal2 wrote:
hsc71 wrote:
It's the way you communicate. Try to be carefull with the words you use in your post. It's easy to insult people just by choosing the wrong words. Bold text and capitals is equal to shouting.
shock. You said "wrong words". I am seriously offended by that!
Seriously, would you care that I am offended? I really hope not... Say what you want, people will find reasons to take offense one way or the other.Hehe, maybe you're right, but the OP still has no answer.............and in the end that's what he/she is looking for. -
How can we know the return code of BDC Program ?
Hi All,
Please tell me : How can we know the return code of BDC Program when being exceuted in Session or in Transaction mode.
In my program, we are uploading data from Excel sheet to SAP via BDC
The records that are not updated we want to create a log file.
Now to know whether a record is updated ot not, wat syst field shloud be used?
Its urgent....
<b>Reward Point will be there ....</b>
Thanks,
HarishHi harish,
try the logic in this code ...
i had attached input file in the end.
TYPES: begin of errmess,
msgnr type t100-msgnr,
text type t100-text,
end of errmess.
TABLES : t100.
DATA: BEGIN OF DD_VA01,
AUART TYPE VBAK-AUART,
KUNNR TYPE RV45A-KUNNR,
BSTKD TYPE VBKD-BSTKD,
MABNR TYPE RV45A-MABNR,
KWMENG(2) type C,
KBETR(2) type C,
END OF DD_VA01.
DATA:IT_VA01 Like TABLE OF DD_VA01,
WA_VA01 Like LINE OF IT_VA01,
WA_VA01_F Like LINE OF IT_VA01,
IT_BDCDATA TYPE TABLE OF BDCDATA,
WA_BDCDATA Like Line OF IT_BDCDATA,
W_FNAME TYPE STRING,
messtab like bdcmsgcoll occurs 0 with header line,
it_errmess type table of errmess,
wa_errmess like line of it_errmess,
err_message type string.
data: zf1 type i,
zc1 type c value '2',
fn(20) type c.
Main Code ************************************************************
PERFORM get_input using 'C:\Documents and Settings\ic881592\Desktop\Daran_bdc_VA01-e.txt'.
SORT IT_VA01 BY AUART KUNNR BSTKD.
LOOP AT IT_VA01 INTO WA_VA01.
if WA_VA01_F-AUART <> WA_VA01-AUART OR
WA_VA01_F-KUNNR <> WA_VA01-KUNNR OR
WA_VA01_F-BSTKD <> WA_VA01-BSTKD.
PERFORM set_header_flag.
PERFORM create_bdc_header_data.
endif.
PERFORM create_bdc_item_data.
ENDLOOP.
PERFORM call_transaction.
PERFORM errorlog.
Procedures ***********************************************************
form get_input using w_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = W_FNAME
HAS_FIELD_SEPARATOR = '#'
TABLES
DATA_TAB = IT_VA01.
endform.
form call_transaction.
PERFORM bdc_field using 'BDC_OKCODE' '/11'.
CALL TRANSACTION 'VA01' USING IT_BDCDATA MODE 'A' messages into messtab.
refresh it_bdcdata.
endform.
FORM set_header_flag.
WA_VA01_F-AUART = WA_VA01-AUART.
WA_VA01_F-KUNNR = WA_VA01-KUNNR.
WA_VA01_F-BSTKD = WA_VA01-BSTKD.
if zf1 = 1.
PERFORM call_transaction.
endif.
zf1 = 1.
endform. "set_header_flag.
form create_bdc_header_data.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'VBAK-AUART' WA_VA01-AUART.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'KUAGV-KUNNR' WA_VA01-KUNNR.
perform bdc_field using 'VBKD-BSTKD' WA_VA01-BSTKD.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR' '04/06'.
perform bdc_field using 'BDC_OKCODE' '=CHOO'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE' '=POAN'.
endform. "create_bdcdata
FORM create_bdc_item_data.
CONCATENATE 'RV45A-KWMENG(' zc1 ')' INTO FN.
perform bdc_field using 'BDC_CURSOR' FN.
perform bdc_field using FN WA_VA01-KWMENG.
CONCATENATE 'KOMV-KBETR(' zc1 ')' INTO FN.
perform bdc_field using FN WA_VA01-KBETR.
CONCATENATE 'RV45A-MABNR(' zc1 ')' INTO FN.
perform bdc_field using FN WA_VA01-MABNR.
perform bdc_dynpro using 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE' '=POAN'.
ENDFORM.
form errorlog.
LOOP AT MESSTAB .
if MESSTAB-MSGNR = '311' or MESSTAB-MSGTYP = 'E'.
SELECT SINGLE msgnr text FROM T100
into wa_errmess
WHERE SPRSL = MESSTAB-MSGSPRA
AND ARBGB = MESSTAB-MSGID
AND MSGNR = MESSTAB-MSGNR.
IF SY-SUBRC = 0.
err_message = wa_errmess-TEXT.
IF err_message CS '&1'.
REPLACE '&1' WITH MESSTAB-MSGV1 INTO err_message.
REPLACE '&2' WITH MESSTAB-MSGV2 INTO err_message.
REPLACE '&3' WITH MESSTAB-MSGV3 INTO err_message.
REPLACE '&4' WITH MESSTAB-MSGV4 INTO err_message.
ELSE.
REPLACE '&' WITH MESSTAB-MSGV1 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV2 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV3 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV4 INTO err_message.
ENDIF.
CONDENSE err_message.
WRITE: / MESSTAB-MSGTYP, err_message .
ELSE.
WRITE: / MESSTAB.
ENDIF.
endif.
ENDLOOP.
endform. "errorlog
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO IT_BDCDATA.
CLEAR WA_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_BDCDATA.
CLEAR WA_BDCDATA.
ENDFORM.
input file :
OR 2148 0001235 R-1162 8 17
OR 2148 0001235 R-1161 2 30
OR 2148 0001235 100-400 6 25
OR 2148 0001235 R-1162 4 12
OR 2148 0001236 R-1162 3 12
OR 2148 0001236 R-1161 2 30
OR 2148 0001236 100-400 1 25
OR 2148 0001236 R-1162 7 12
OR 2148 0001236 R-1161 8 30
OR 2148 0001236 100-400 10 25
OR 2148 0001235 R-1161 5 30
OR 2148 0001235 100-400 2 25
OR 2148 0001235 R-11621 3 12
OR 2148 0001235 R-1161 2 30
OR 2148 0001235 100-400 1 25
OR 2148 0001235 R-1162 7 12
OR 2148 0001235 R-1161 8 30
OR 2148 0001235 100-400 10 25
OR 2148 0001236 R-1162 8 17
OR 2148 0001236 R-1161 2 30
OR 2148 0001236 100-400 6 25
OR 2148 0001236 R-1162 4 12
OR 2148 0001236 R-1161 5 30
OR 2148 0001236 100-400 2 25 -
How can i use the project code instead of project xml?
hello
i use the sessionbean+toplink structure,after i finish the o-r mapping by using the mapping work bench,i generate the project xml file,then in the "session.xml" file,i refer to the project xml,then i can use it from sessionbean.
i hear that if i use the project code instead of project xml file,it will be more performant,is that true?
otherwise,how can i use the project code instead of project xml file?i mean, in "session.xml", i can use the "<project-xml>" tag to refer to the project xml file,then in my session bean,i get the server session by read the "session.xml" file.but if i use the project code,how can i refer it from the "session.xml"?the examples that come with the toplink installation only tell me how can i use the project xml file within the session bean,it don't give me any clue about using the project code in the sesion bean,who can give me a step-by-step instruction and code snippet?
thank you very much?There is a slight performance gain during session load at startup but there is no difference at runtime. The choice of which to use is dependent upon you build process. Whether it is easier to submit a new version of the class into the comile build process vs an XML file. In most cases it is just a preference of the development team.
When you use the project-class you'll need to generate the source code and compile it into your system. Typically it is packaged with the persistent classes. You may need to configure your environment so that the class-loaders have access to these classes (same for the XML case).
When using the project-class you simply replace the project-xml entry like this:
<project-class>oracle.toplink.demos.employee.relational.EmployeeProject</project-class>
The DTD for the session.xml file is found at <TOPLINK_HOME>\core\sessions_4_5.dtd. It is also in the documentation at:
http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/toplink.903/b10064/a-sessio.htm#634246
Doug Clarke
Product Manager
Oracle9iAS TopLink -
How can I generate javadoc in PDF format?
Hi,
How can I generate javadoc in PDF format?
Thanks,
FayezinHTML to PDF with Java, using OpenOffice.org - example here: [http://www.dancrintea.ro/html-to-pdf/|http://www.dancrintea.ro/html-to-pdf/]
You can use OpenOffice.org, running as a server and command it remotely for document convertion.
Besides HTML to PDF, there are also possible other convertions:
doc --> pdf, html, txt, rtf
xls --> pdf, html, csv
ppt --> pdf, swf
Code example:
import officetools.OfficeFile; // this is my tools package
FileInputStream fis = new FileInputStream(new File("c:/test.html"));
FileOutputStream fos = new FileOutputStream(new File("c:/test.pdf"));
// suppose OpenOffice.org runs on localhost, port 8100
OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
f.convert(fos,"pdf");
----------------------------------------------------------------------------------------------------------------------------------------- -
How can i find start line of any functions or procedures stored in package body?
hi
how can i find start line of any functions or procedures stored in package body?
is there any way to write a query from for example user_source?
thankshow can i find start line of any functions or procedures stored in package body?
Why? What will you do differently if a procedure starts on line 173 instead of line 254?
Tell us what PROBLEM you are trying to solve so we can help you find the best way to solve it.
If you use PL_SCOPE that info is available in the *_IDENTIFIERS views. See 'Using PL/Scope in the Advanced Dev Doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_plscope.htm
Try this simple sample code. The query is modified from that doc sample:
-- tell the compiler to collect the info
ALTER SESSION SET PLSCOPE_SETTINGS='IDENTIFIERS:ALL';
-- recompile the package
CREATE OR REPLACE package SCOTT.pack1 as
PROCEDURE proc1;
PROCEDURE proc2;
END;
CREATE OR REPLACE package BODY SCOTT.pack1 as
PROCEDURE proc1 IS
BEGIN
NULL;
END;
PROCEDURE proc2 IS
BEGIN
proc1;
END;
PROCEDURE proc3 IS
BEGIN
proc1;
proc2;
END;
END;
-- query the info for the package spec
WITH v AS (
SELECT Line,
Col,
INITCAP(NAME) Name,
LOWER(TYPE) Type,
LOWER(USAGE) Usage,
USAGE_ID,
USAGE_CONTEXT_ID
FROM USER_IDENTIFIERS
WHERE Object_Name = 'PACK1'
AND Object_Type = 'PACKAGE'
SELECT LINE, RPAD(LPAD(' ', 2*(Level-1)) ||
Name, 20, '.')||' '||
RPAD(Type, 20)||
RPAD(Usage, 20)
IDENTIFIER_USAGE_CONTEXTS
FROM v
START WITH USAGE_CONTEXT_ID = 0
CONNECT BY PRIOR USAGE_ID = USAGE_CONTEXT_ID
ORDER SIBLINGS BY Line, Col
LINE,IDENTIFIER_USAGE_CONTEXTS
1,Pack1............... package declaration
2, Proc1............. procedure declaration
3, Proc2............. procedure declaration
-- query the info for the package body - change 'PACKAGE' to 'PACKAGE BODY' in the query above
LINE,IDENTIFIER_USAGE_CONTEXTS
1,Pack1............... package definition
2, Proc1............. procedure definition
6, Proc2............. procedure definition
8, Proc1........... procedure call
10, Proc3............. procedure declaration
10, Proc3........... procedure definition
12, Proc1......... procedure call
13, Proc2......... procedure call -
How can I eliminate quicktime error code 36
How can I eliminate quicktime error code 36
Hello,
Error -36 stands for an I/O Error.
File is not readable. You would need to generate a clean, error-free copy of the damaged file. Since some segments of the file are not readable, the best that can be done is to skip them.
See: http://aeroquartet.com/movierepair/quicktime-errors
and
http://aeroquartet.com/wordpress/2012/06/06/how-to-copy-a-file-with-io-errors/
Kind Regards,
Javier
I may receive some form of compensation, financial or otherwise, from my recommendation or link. -
How can i generate xml like this?
Hi all,
How can i generate xml like this & i need to send it to via HTTP :
<mms>
<subject>message subject</subject>
<url_image>http://image_url</url_image>
<url_sound>http://sound_url</url_sound>
<url_video>http://video_url</url_video>
<text>message text</text>
<msisdn_sender>6281XYYYYYY</msisdn_sender>
<msisdn_receipient>6281XYYYYYY</msisdn_receipient>
<sid>to be define later</sid>
<trx_id>Unique number</trx_id>
<trx_date>yyyyMMddHHmmss</trx_date>
<contentid>see note</contentid>
</mms>& how can i get the value of the sid (for example)?
I hav tried to generate that xml by using StringBuffer & append, but it's not what i mean...
Anyone can help me?Ok...i got it. But i still hav some problems.
This is the sample code that i used :
public class XMLCreator {
//No generics
List myData;
Document dom;
Element rootEle, mmsEle, mmsE;
StringWriter stringOut;
mms mms;
public XMLCreator(String subject, String image, String sound,
String video, String text, String sender, String recipient,
int id, String date, String contentid) {
mms = new mms(subject, image, sound, video, text, sender,
recipient, id, contentid, date);
createDocument();
public void run(){
createDOMTree();
print();
private void createDocument() {
//get an instance of factory
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
//get an instance of builder
DocumentBuilder db = dbf.newDocumentBuilder();
//create an instance of DOM
dom = db.newDocument();
}catch(ParserConfigurationException pce) {
//dump it
System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
private void createDOMTree(){
//create the root element <Mms>
rootEle = dom.createElement("mms");
dom.appendChild(rootEle);
createMmsElement(mms);
private Element createMmsElement(mms b){
Element subjectEle = dom.createElement("subject");
Text subjectText = dom.createTextNode(b.getSubject());
subjectEle.appendChild(subjectText);
rootEle.appendChild(subjectEle);
//create url_image element and author text node and attach it to mmsElement
Element imageEle = dom.createElement("url_image");
Text imageText = dom.createTextNode(b.getUrl_image());
imageEle.appendChild(imageText);
rootEle.appendChild(imageEle);
// & etc....
return rootEle;
* This method uses Xerces specific classes
* prints the XML document to file.
private void print(){
try
//print
OutputFormat format = new OutputFormat(dom);
format.setIndenting(true);
stringOut = new StringWriter();
//to generate output to console use this serializer
XMLSerializer serializer = new XMLSerializer(stringOut, format);
//to generate a file output use fileoutputstream instead of system.out
//XMLSerializer serializer = new XMLSerializer(
//new FileOutputStream(new File("mms.xml")), format);
serializer.serialize(dom);
} catch(IOException ie) {
ie.printStackTrace();
public String getStringOut() {
return stringOut.toString();
}when i tried to show the stringOut.toString() in my jsp, it's only showed string like this :
The Lords Of The Ring http://localhost:8084/movie/lotr.3gp 6281321488448 6281321488448 123 0 20070220114851 LOTR.
1. Why this is happen?i want to generate xml which its format is like above.
2. How can i send this xml (put in msg parameter) using jsp (via web) without creating the mms.xml?
3. if i want to set the msg parameter equal to mms.xml - means that msg = mms.xml, what is the data type for msg? is it an object or anything else?
Thx b4 in advance...
Maybe you are looking for
-
HT201209 Can I move money from one Apple ID to another?
I'm hoping I can somehow transfer my iTunes gift card money!
-
Why can't I download photos from my iPhone to iPhoto?
When I try to download photos from my iPhone to iPhoto, it says: Help please?
-
Because I'm unable to invoke the "Select All Unused" menu item of the Swatches panel menu I'm trying to attack it programmatically. What I'm trying to determine is if it's sufficient to compare the Fill and Stroke Color of each Path Item (every path
-
Hi , I recently had problem with Adobe Reader ( Asking for it to be re-installed) then checking I found my other Adobe products had the same issue. So I uninstalled: Reader Flash Shock Player AIR I managed to re-install all but AIR. which says error
-
Automate Print from Crystal Viewer
Is there any C# .NET web application code that will trigger the Print button on the CrystalReportsViewer toolbar? I was sent the code below in another thread, but have not been able to get it to work in C#. It says that 'ctrl' can never be type Windo