How to initialize the array with object?

Here is type I have.
CREATE OR REPLACE TYPE SYSADM.AP_COMMENT_TYPE AS OBJECT
BU_AP VARCHAR2(5),
VOUCHER VARCHAR2(10),
V_LINE INTEGER,
USERID VARCHAR2(20),
COMMENT_DTTM DATE,
COMMENT VARCHAR2(254)
CREATE OR REPLACE TYPE SYSADM.AP_COMMENT_COLL AS VARRAY(1000) OF SYSADM.AP_COMMENT_TYPE;
Then I created a procedure to grab some data.
PROCEDURE get_voucher_comments (
v_bu_in IN VARCHAR2,
v_voucher_in IN VARCHAR2,
v_line_in IN NUMBER,
v_userid IN VARCHAR2,
voucher_comment OUT      sysadm.ap_comment_coll
IS
i NUMBER := 1;
v_comments VARCHAR2 (254) := ' ';
comment_type sysadm.ap_comment_type;
v_line_num NUMBER := 0;
CURSOR get_all_comment
IS
SELECT voucher_line_num, descr254_mixed
FROM ps_fas_ap_comment
WHERE business_unit = voucher_comment (i).bu_ap
AND voucher_id = voucher_comment (i).voucher;
CURSOR get_line_comment
IS
SELECT descr254_mixed
FROM ps_fas_ap_comment
WHERE business_unit = voucher_comment (i).bu_ap
AND voucher_id = voucher_comment (i).voucher
AND voucher_line_num = voucher_comment (i).v_line;
BEGIN
voucher_comment (1) := ap_comment_type (' ', ' ', 0, ' ', '', ' ');
--voucher_comment (1) := ap_comment_type (null, null, null, null, null,null);
IF voucher_comment (i).v_line = 0
THEN
OPEN get_all_comment;
LOOP
FETCH get_all_comment
INTO v_line_num, v_comments;
          voucher_comment.EXTEND;
voucher_comment (i) :=
ap_comment_type (v_bu_in,
v_voucher_in,
v_line_num,
v_userid,
TO_DATE (TO_CHAR (SYSDATE,
'DD-MON-YYYY HH24:MI:SS'
'DD-MON-YYYY HH24:MI:SS'
v_comments
i := i + 1;
END LOOP;
ELSE
OPEN get_line_comment;
LOOP
FETCH get_line_comment
INTO v_comments;
          voucher_comment.EXTEND;
voucher_comment (i) :=
ap_comment_type (v_bu_in,
v_voucher_in,
v_line_num,
v_userid,
TO_DATE (TO_CHAR (SYSDATE,
'DD-MON-YYYY HH24:MI:SS'
'DD-MON-YYYY HH24:MI:SS'
v_comments
i := i + 1;
END LOOP;
END IF;
END get_voucher_comments;
But when I tried to test the procedure, got error: ORA-06531: Reference to uninitialized collection. Does anyone have experience of handling array with object?
declare
O_voucher_comment SYSADM.AP_COMMENT_COLL;
begin
FAS_AP_EXCEPTIONS.GET_VOUCHER_COMMENTS('FCCAN', '20494753', 1, 'KEHE', O_voucher_comment);
end;

Thanks for that. I changed it a little bit, but when i ran this script, got ORA-06532: Subscript outside of limit.
declare
O_voucher_comment SYSADM.AP_COMMENT_COLL := sysadm.ap_comment_coll(null);
begin
FAS_AP_EXCEPTIONS.GET_VOUCHER_COMMENTS('FCCAN', '20494753', 0, 'KEHE', O_voucher_comment);
end;
PROCEDURE get_voucher_comments (
v_bu_in IN VARCHAR2,
v_voucher_in IN VARCHAR2,
v_line_in IN NUMBER,
v_userid IN VARCHAR2,
voucher_comment OUT      sysadm.ap_comment_coll
IS
i NUMBER := 1;
v_comments VARCHAR2 (254) := ' ';
comment_type sysadm.ap_comment_type;
v_line_num NUMBER := 0;
CURSOR get_all_comment
IS
SELECT voucher_line_num, descr254_mixed FROM ps_fas_ap_comment
WHERE business_unit = v_bu_in AND voucher_id = v_voucher_in;
CURSOR get_line_comment
IS
SELECT descr254_mixed FROM ps_fas_ap_comment
WHERE business_unit = v_bu_in AND voucher_id = v_voucher_in
AND voucher_line_num = v_line_in;
BEGIN
--voucher_comment() := SYSADM.ap_comment_type (NULL, NULL, NULL, NULL, NULL, NULL);
--' ', ' ', 0, ' ', '', ' ' sysadm.ap_comment_coll
voucher_comment := sysadm.ap_comment_coll(null);
IF v_line_in = 0
THEN
OPEN get_all_comment;
LOOP
FETCH get_all_comment
INTO v_line_num, v_comments;
          if i > 1
          then
               voucher_comment.EXTEND;
          end if;
voucher_comment (i) := ap_comment_type (v_bu_in,
v_voucher_in, v_line_num, v_userid,
TO_DATE (TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS'), 'DD-MON-YYYY HH24:MI:SS'), v_comments );
i := i + 1;
END LOOP;
ELSE
OPEN get_line_comment;
LOOP
FETCH get_line_comment
INTO v_comments;
          voucher_comment.extend(6);
voucher_comment (i) := ap_comment_type (v_bu_in, v_voucher_in, v_line_num, v_userid, TO_DATE (TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS' ), 'DD-MON-YYYY HH24:MI:SS'), v_comments);
i := i + 1;
END LOOP;
END IF;
END get_voucher_comments;

Similar Messages

  • How to initialize the array of hashmap???

    how to initialize the array of hashmap??

    What do you mean by "the array of hashmap"?

  • How to initialize the index with "at new" command ??

    Hi All,
    I am facing a problem of Initializing the index .
    I want to Initialize the Index with the " at new "
    command within a loop but its not working.
    Otherwise,please tell me the way to put a flag on the first record with " at new " command.
    Please provide a solution ASAP.

    loop at itab.
    if sy-index = 1.
    set ur flag.
    endloop.
    check the code below..
      LOOP AT lt_citm_b INTO wa_citm_b.
        AT NEW vbeln .
          CLEAR: wa_temp_output , lt_temp_output[].
        ENDAT.
        AT LAST.
          lv_t = 'X'.
        ENDAT.
        LOOP AT lt_char INTO wa_char WHERE instance = wa_citm_b-instance.
          MOVE:  c_d TO wa_temp_output-type,
          wa_citm_b-vbeln TO wa_temp_output-vbeln,
          wa_citm_b-posnr TO wa_temp_output-posnr,
          wa_citm_b-matnr TO wa_temp_output-matnr.
          MOVE-CORRESPONDING wa_char TO wa_temp_output.
    Special requirement
         IF wa_temp_output-atnam = c_itr AND wa_temp_output-atwrt = c_itr03
                                                        OR
           wa_temp_output-atnam = c_cosr AND wa_temp_output-atwrt = c_osr03.
            CLEAR: wa_temp_output-atnam, wa_temp_output-atwrt.
            MOVE: c_iorp TO wa_temp_output-atnam,
                  c_in2-os_nd TO wa_temp_output-atwrt,
                  'X' TO wa_temp_output-flag.
          ENDIF.
    *If the characteristic value for PMFREQUENCIE is initial need to pull
    *the floating value.
          PERFORM fr_get_float TABLES lt_char USING wa_char-atwrt
                                                    wa_char-instance
                                                    wa_char-atnam
                                           CHANGING wa_temp_output-atwrt.
    *To recognize if contract item have extended and standard
    *characteristics.
          PERFORM fr_ext_std USING wa_temp_output-atnam
                          CHANGING wa_temp_output-ext
                                   wa_temp_output-std.
          APPEND wa_temp_output TO lt_temp_output.
          CLEAR: wa_temp_output, wa_char.
        ENDLOOP.
        SORT lt_temp_output BY vbeln posnr std ext.
        AT END OF vbeln.
    To translate the data according to the mapping rules
          PERFORM fr_translate.
          IF lv_t = 'X'.
            DESCRIBE TABLE lt_output LINES gv_count.
            READ TABLE lt_output INTO wa_output INDEX gv_count.
            IF sy-subrc EQ 0.
              CLEAR wa_output.
              MOVE:  c_t TO wa_output-type.
              APPEND wa_output TO lt_output.
            ENDIF.
          ENDIF.

  • How to get the array with in the array in plsql?

    Hi,
    I have a table contains the data like below strcture.
    LINE_NUMBER     TAG_NUMBER     NOTES     TORQUE_1     TORQUE_2     TORQUE_3
    1          SSS          SUCCESS     2000          3000          4000
    1          SSS          SUCCESS     4000          5000          6000
    1          SSS          SUCCESS     7000          4000          8000
    2          YYY          FAIL     200          300          400
    2          YYY          FAIL     400          500          600
    2          YYY          FAIL     700          400          800From the above table data line_number, tag_number and notes are the commom values for the particular line number. If you see the line number 1, we have three records torque values with different torque values for one line number. Now i have to create a stored procedure to store the line_number, tag_number and notes in one array then remaining torque column for another array. The output should be the below. The output will be for line number 1 is for array1 and remaining torque values for that lin number is another array2. The same line number 2 is will come in array1 and torque information of line number 2 is for another array2. This will be structure.
    Array_1 Count :2
    Array_2 Count :6
    1: LINE_NUMBER: 1: TAG_NUMBER: SSS, NOTES: SUCCESS
    1: TORQUE_1:2000, TORQUE_2:3000, TORQUE_3:4000
    2: TORQUE_1:4000, TORQUE_2:5000, TORQUE_3:6000
    3: TORQUE_1:7000, TORQUE_2:4000, TORQUE_3:8000
    2: LINE_NUMBER: 2: TAG_NUMBER: YYY, CUST_NUMBER: FAIL
    1: TORQUE_1:200, TORQUE_2:300, TORQUE_3:400
    2: TORQUE_1:400, TORQUE_2:500, TORQUE_3:600
    3: TORQUE_1:700, TORQUE_2:400, TORQUE_3:800Can anyone share with your thoughts?
    Thanks
    Edited by: orasuriya on Jul 10, 2009 10:33 AM

    Not sure why you need pl/sql
    WITH YOUR_TABLE AS
    SELECT 1 LINE_NUMBER, 'SSS' TAG_NUMBER, 'SUCCESS' NOTES, 2000 TORQUE_1, 3000 TORQUE_2, 4000 TORQUE_3 FROM DUAL
    UNION ALL
    SELECT 1,'SSS','SUCCESS',4000,5000,6000 FROM DUAL
    UNION ALL
    SELECT 1,'SSS','SUCCESS',7000,4000,8000 FROM DUAL
    UNION ALL
    SELECT 2,'YYY','FAIL',200,300,400 FROM DUAL
    UNION ALL
    SELECT 2,'YYY','FAIL',400,500,600 FROM DUAL
    UNION ALL
    SELECT 2,'YYY','FAIL',700,4000,800 FROM DUAL
    SELECT     DECODE (rn, 0, line_number, rn) || ':',
               col_val3,
               col_val2,
               col_val3
    FROM       (SELECT   0 rn,
                         line_number,
                         tag_number,
                         notes,
                         'LINE_NUMBER:' || line_number col_val1,
                         'TAG_NUMBER:' || tag_number col_val2,
                         'NOTES:' || notes col_val3
                FROM     your_table
                UNION
                SELECT   ROW_NUMBER ()
                           OVER (PARTITION BY line_number, tag_number, notes
                                 ORDER BY ROWNUM
                         line_number,
                         tag_number,
                         notes,
                         'TORQUE_1:' || torque_1,
                         'TORQUE_2:' || torque_2,
                         'TORQUE_3:' || torque_3
                FROM     your_table)
    ORDER BY   line_number, tag_number, notes, rn

  • How to find the text id & object name to be used with read_text  ?

    Hi All
    how to determine the text id & object name associated with PO to be used with FM read_text  ?
    Regards
    Jaman

    Hi,
    For PO there will be Header Texts and Item texts.
    For header texts just Take the PO number as TDNAME.
    for Item texts Conactenate the PO number and Item Number and use as TDNAME.
    in ME23N Go to any text.Double click on it
    It will take you to text editor.
    GOTO-> header
    it will display the TEXT  ID,TEXTNAME,LANG  and TEXT OBJECT etc
    Similarly for every  text you will find and use;
    Regards,
    Anji

  • Dynamically built query on execution How to save the data in Object Type

    Hi,
    In pl/sql I am building and executing a query dynamically. How can I stored the output of the query in object type. I have defined the following object type and need to store the
    output of the query in it. Here is the Object Type I have
    CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPE AS OBJECT(
    pkid NUMBER,
    pkname VARCHAR2(100);
    pkcity VARCHAR2(100);
    pkcounty VARCHAR2(100)
    CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPETAB AS TABLE OF FIRST_RECORDTYPE;Here is the query generated at runtime and is inside a LOOP
    --I initialize my Object Type*
    data := new FIRST_RECORDTYPETAB();
    FOR some_cursor IN c_get_ids (username)
    LOOP
    x_context_count := x_context_count + 1;
    -- here I build the query dynamically and the same query generated is
    sql_query := 'SELECT pkid as pid ,pkname as pname,pkcity as pcity, pkcounty as pcounty FROM cities WHERE passed = <this value changes on every iteration of the cursor>'
    -- and now I need to execute the above query but need to store the output
    EXECUTE IMMEDIATE sql_query
    INTO *<I need to save the out put in the Type I defined>*
    END LOOP;
    How can I save the output of the dynamically built query in the Object Type. As I am looping so the type can have several records.
    Any help is appreciated.
    Thanks

    hai ,
    solution for Dynamically built query on execution How to save the data in Object Type.
    Step 1:(Object creation)
    SQL> ED
    Wrote file afiedt.buf
    1 Create Or Replace Type contract_details As Object(
    2 contract_number Varchar2(15),
    3 contrcat_branch Varchar2(15)
    4* );
    SQL> /
    Type created.
    Step 2:(table creation with object)
    SQL> Create Table contract_dtls(Id Number,contract contract_details)
    2 /
    Table created.
    Step 3:(execution Of procedure to insert the dynamic ouput into object types):
    Declare
    LV_V_SQL_QUERY Varchar2(4000);
    LV_N_CURSOR Integer;
    LV_N_EXECUTE_CURSOR Integer;
    LV_V_CONTRACT_BR Varchar2(15) := 'TNW'; -- change the branch name by making this as input parameter for a procedure or function
    OV_V_CONTRACT_NUMBER Varchar2(15);
    LV_V_CONTRACT_BRANCH Varchar2(15);
    Begin
    LV_V_SQL_QUERY := 'SELECT CONTRACT_NUMBER,CONTRACT_BRANCH FROM CC_CONTRACT_MASTER WHERE CONTRACT_BRANCH = '''||LV_V_CONTRACT_BR||'''';
    LV_N_CURSOR := Dbms_Sql.open_Cursor;
    Dbms_Sql.parse(LV_N_CURSOR,LV_V_SQL_QUERY,2);
    Dbms_Sql.define_Column(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER,15);
    Dbms_Sql.define_Column(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH,15);
    LV_N_EXECUTE_CURSOR := Dbms_Sql.Execute(LV_N_CURSOR);
    Loop
    Exit When Dbms_Sql.fetch_Rows (LV_N_CURSOR)= 0;
    Dbms_Sql.column_Value(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER);
    Dbms_Sql.column_Value(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH);
    Dbms_Output.put_Line('CONTRACT_BRANCH--'||LV_V_CONTRACT_BRANCH);
    Dbms_Output.put_Line('CONTRACT_NUMBER--'||OV_V_CONTRACT_NUMBER);
    INSERT INTO contract_dtls VALUES(1,CONTRACT_DETAILS(OV_V_CONTRACT_NUMBER,LV_V_CONTRACT_BRANCH));
    End Loop;
    Dbms_Sql.close_Cursor (LV_N_CURSOR);
    COMMIT;
    Exception
    When Others Then
    Dbms_Output.put_Line('SQLERRM--'||Sqlerrm);
    Dbms_Output.put_Line('SQLERRM--'||Sqlcode);
    End;
    step 4:check the values are inseted in the object included table
    SELECT * FROM contract_dtls;
    Regards
    C.karukkuvel

  • How to list an array of objects using struts in jsp and ActionForm

    I am using the struts ActionForm and need to know how to display an Array of objects. I am assuming it would look like this in the ActionForm:
    private AddRmvParts addRmv[];
    But I am not sure how the getter and setter in the ActionForm should look. Should it be a Collection or an Iterator?
    I am thinking I need to use an iterator in the jsp page to display it.
    I am also wondering if the AddRmvParts class I have can be the same class that gets populated by the retrieval of data from the database. This class has 10 fields that need to display on the jsp page in 1 row and then multiple rows of these 10 fields.
    Thanks.

    Most probably the easiest way to make it accessible in your page is as a collection.
    ie
    public Collection getAddRmvParts()
    You can use the <logic:iterate> or a <c:forEach>(JSTL) tag to loop through the collection
    As long as the individual items in the collection provide get/set methods you can access them with the dot syntax:
    Example using JSTL:
    <c:forEach var="addRmvPart" items="${addRmvParts}">
      <c:out value="${addRmvPart.id} ${addRmvPart.name} ${addRmvPart.description}"/>
    </c:forEach>

  • How to delete the file with space in name

    Hi
    I want to delete the file "test ex.txt" file.
    i run the following command in command prompt.i can delete the file successfully.
    /bin/rm -f /mnt/"test ex.txt"
    I want to run the command from java.So i am using the following code
    String cmd = "/bin/rm -f /mnt/\"test ex.txt\"";
         Runtime rt = Runtime.getRuntime();
    process = rt.exec(cmd);
    The file was not deleted.
    How to delete the file with space in name?
    Help me

    Use the form of exec that takes an array of command + args.
    arr[0] = "/bin/rm"
    arr[1] = "-f"
    arr[2] = "/home/me/some directory with spaces";Or use ProcessBuilder, which is the preferred replacement for Runtime.exec, and which Runtime.exec calls.

  • How to build a array with high sampling rates 1K

    Hi All:
    Now I am trying to develop a project with CRio.
    But I am not sure how to build a array with high sampling rates signal, like >1K. (Sigle-point data)
    Before, I would like to use "Build Arrary" and "Shift Register" to build a arrary, but I found it is not working for high sampling rates.
    Is there anyother good way to build a data arrary for high sampling rates??
    Thanks
    Attachments:
    Building_Array_high_rates.JPG ‏120 KB

    Can't give a sample of the FPGA right now but here is a sample bit of RT code I recently used. I am acquiring data at 51,200 samples every second. I put the data in a FIFO on the FPGA side, then I read from that FIFO on the RT side and insert the data into a pre-initialized array using "Replace Array subset" NOT "Insert into array". I keep a count of the data I have read/inserted, and once I am at 51,200 samples, I know I have 1 full second of data. At this point, I add it to a queue which sends it to another loop to be processed. Also, I don't use the new index terminal in my subVI because I know I am always adding 6400 elements so I can just multiply my counter by 6400, but if you use the method described further down below , you will want to use the "new index" to return a value because you may not always read the same number of elements using that method.
    The reason I use a timeout of 0 and a wait until next ms multiple is because if you use a timeout wired to the FIFO read node, it spins a loop in the background that polls for data, which rails your processor. Depending on what type of acquisition you are doing, you can also use the method of reading 0 elements, then using the "elements remaining" variable, to wire up another node as is shown below. This was not an option for me because of my programs architecture and needing chunks of 1 second data. Had I used this method it would have overcomplicated things if I read more elements then I had available in my 51,200 buffer.
    Let me knwo if you have more qeustions
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    RT.PNG ‏36 KB
    FIFO read.PNG ‏4 KB

  • How to populate an array with random text files.

    I am making a Jeopardy program. I have my program set up so that it retrieves 5 random text files. I just want to know how I populate one array with all the lines from the text files my program is retrieving.

    You can read a textfile line by line and add each line to an ArrayList. An ArrayList is very much like an array only that it's "open ended". You can start adding lines without first knowing how many you're going to get. If you still want an ordinary "static" array when you're finished reading lines you can easily get one from the ArrayList and then drop the ArrayList.

  • How to initialize the new internal hard disk in LapTop ?

    Folks,
    Hello.
    My LapTop model is HP Pavilion dv4-2045dx entertainment notebook whose host operating system is Windows 7.
    Because the current hard disk capacity is not enough, I need to replace it with a new hard disk with bigger capacity.
    After take out the old hard disk and install "750 GB 7200 rpm Western Digital Scorpio Black 9 mm internal hard drive" into my LapTop, how to initialize the new hard disk ? What is the host Operating System for the new hard disk ?

    Please see the answer in your other thread.
    Which external hard drive supports Oracle Linux 5 on top of VMPlayer ?

  • Microsoft Access Text Driver missing! and ...Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

    In order to use OpenRowSet, I installded Microsoft Access Database Engine 2010. However, I could not find Microsoft Access Text Driver in Drivers of ODBC Data Source Administrator.  Could I get some help with that?
    Thank you very much!

    I am local admin and try to run the following script, but I got an error. Could anyone help me look at it?
    EXEC sp_configure 'show advanced options', 1
    go
    RECONFIGURE
    GO
    EXEC sp_configure 'ad hoc distributed queries', 1
    go
    RECONFIGURE
    GO
    SELECT * FROM OPENROWSET('MSDASQL',
    'Driver={Microsoft Access Text Driver (*.txt, *.csv)};
    DefaultDir=D:\;','SELECT * FROM Test.csv')
    Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
    Configuration option 'Ad Hoc Distributed Queries' changed from 1 to 1. Run the RECONFIGURE statement to install.
    OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
    Msg 7303, Level 16, State 1, Line 1
    Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

  • A friend created 3 accounts on his iPhone 5 but forgot the passwords. He can't reset the password as yahoo address is no longer valid. Erasing the phone doesn't solve the issue. How to register the phone with Apple?

    A computer illiterate friend created 3 accounts on his iPhone 5 but forgot the passwords. He can't reset the password as his yahoo address is no longer valid. Erasing the phone doesn't solve the issue as the Apple server identifies the hardware as registered. How to register the phone with Apple?
    I helped him create a new email address and new iCloud account on my Mac but when we try to register the phone with Apple it says: Maximim accounts limit reached for this device. How can he register the phone? I read different threads and found out that only Apple care can do that. We're in Romania and don't know where to call. Any suggestions on how we fix this?

    When I checked the support site for Romania, you apparently don't have an Apple Care contact center.  You "may" try calling the US Apple care number to verify the account and have the password reset sent to a different email address.  800-694-7466

  • I have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending

    i have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending the mail.
    Also the mail is acting very funny by not getting the rules work in a proper method.  Is ther a software to repair mail.

    i did both of them, but still the while sending the mail the diolog box is not showing up and also the spelling and grammer does not do the spelling check. 
    This problem just started for about 3 to 4 days now.  earlier it was working normally.

  • 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>

Maybe you are looking for

  • Material type for BOM that should not create production order

    Hello all, We have following situation in our company: We ship few products say for e.g A,B,C which are part of higer level BOM for product M1  to the customer, before the actual product M1 is shipped.Currently these ship-a-head products(A,B,C) is al

  • Spotlight search for Address Book contact results in import query?

    This bug is happening frequently lately, wheby I perform a Spotlight seach for a contact that is in my Address Book, and then when I select the contact in the search results, Address Book is selected and the app asks me "Are you sure you want to impo

  • Photoshop cc can't open and make new documents.

    I'm using adobe creative cloud and photoshop cc. When I run the Photoshop cc, it can't open and create new documents. Open and make new documents Photoshop don't work so i terminate a photoshop cc use windows task manager. I use windows7 ultimate k o

  • HELP!! Export Problems

    Ok, new to fireworks need some help big time. I have a finished prototype that I'm trying to export into a working website. I get that Fireworks isn't the best exporter as far as more complicated designs, but I'm kind of at a loss on what to do. I've

  • Learning Photoshop

    We are a small business that has traditionally outsourced our photoshop needs to a small business locally. However, the other business is getting much bigger and wants more work from us to continue the relationship. We have decided to try some of the