XML/XPath question--how to select a range of elements with XPath?

Hi there,
I have an XML DOM in memory. I need to do hold it and issue only parts of it to my client app in "pages". Each page would be a self-contained XML doc, but would be a subset of the original doc. So for instance the first page is top-level elements 1-5. 2nd page would be 6-10 etc. Is this solution best solved with XPath? If not, what's the best way? If so, I have the following question:
Is there a way to use XPath to select a range of nodes based on position within the document? I know I can do an XPath query that will return a single Node based on position. So for example if I wanted the first node in some XML Book Catalog I could do XPathAPI.selectSingleNode(doc, "/Catalog/Book[position()=1]"); I could wrap the previous call in a loop, replacing the numeric literal each time, but that seems horribly inefficient.
Any ideas? Thanks much in advance!
Toby Buckley

Your question is about marking a range of cells. 99% of the code posted has nothing to do with this. If you want to create a simple table for test purposes then just do:
JTable table = new JTable(10, 5);
JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );
In three line of code you have a simple demo program.
When I leave the mouse button again, these bunch/range of cells shall stay "marked". table.setCellSelectionEnabled( true );
and I'd like to obtain, say, a vector of a vector containing just those data marked beforeUse the getSelectedRows() and getSelectedColumns() methods for this information. I would suggest you create a Point object to reflect the row/column position and then add the point to an ArrayList.

Similar Messages

  • Question: How to assign number ranges to the Official Excise Document Numbe

    Question: How to assign number ranges to the Official Excise Document Number
    Field name is: EXNUM, table name: J_1IEXCHDR
    SAP CIN
    Dear expert,
    I will briefly explain the scenario:
    I have created return po.
    Process MIGO w.r.t. return PO- Material document generated.
    Process: J1IS - excise invoice other movement create.
    --> Now I want to print the document --> I m trying with T-code J1IP --> entered all the required data --. Used out put type - J1I0
    But I am not getting the list of document for printing and even print is not coming.
    There is no print document getting for a printing.
    When I checked in an above said table (mentioned in question), I found that for transaction type OTHR, there is no number ranges defined for official document no.
    And because of this reason I m not getting any document in the print.
    Can you Pl extend Ur help and Pl suggest me where (path or transaction) the number ranges can be maintained for the official excise document No.
    Thanking you all n advance and expecting your earliest response.
    Regards
    om

    Dear Friend,
    J_1IEXCHDR this table stores the all the excise documents created while excise transactions are done ,
    for that Goto j1i9 or SNRO  in these transaction you maintiane the number ranges  for the
    J_1IPLA2     PLA part II number range object
    J_1IRG1     RG1 Number range object
    J_1IRG1_T     No. Range for RG1 - Excise group / Material
    J_1IRG23A1     RG23A part 1 no. range object
    J_1IRG23A2     RG23A part II number range object
    J_1IRG23C1     RG23C part I number range object
    J_1IRG23C2     RG23C part II number range object
    J_1IRG23D     Folio Numbers for RG 23D
    like these  lot of objects are there  for them u maintiane the no. ranges
    Regards
    Pramod

  • How to select TIME range in NSDatePicker

    Hi
    I want to select time period with NSDatePicker. Working hours.
    I dropped NSDatePicker, selected graphical style (as only with this style range selection works). Set 'selects' to 'date range'. Hid year, month, day selection and leave only hours and minutes.
    So now I have fance clock, but I wonder how to select RANGE with them?!

    Hello,
    you could work with two variables, one for the "from" value and another one for the "to" value.
    reagrds
    Cornelia

  • How to select a range of frames

    Is there any way to select a range of frames in Scout beyond dragging the little handles in the "Frame timeline window" or using "Ctrl-A" to select all?
    For a large trace having to drag the handles is very tedious if it's across a minute's worth of frames, but we don't want to select them all.
    What we're looking for is like the "Goto Frame" option in the menu, but to select a start and end frame that way.  Not just jump to the frame.
    Or the ability to click in the Frame timeline window to set the start/end frame, without grabbing and dragging a handle (which may be way off screen).
    Is there some way to do this?
    Or is there any way to select a frame range in the overall frame summary window above the timeline?
    Thanks,
    Doug

    In the frame timeline, you can hold down the Shift key and click, to change the end-frame of the selection. You can also click and drag to select multiple frames.

  • How to select values of nested elements that have maxOccurs="unbounded"

    I have the following xml schema and xml data:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qbl="http://10.0.1.233:8080/home/cpa/xsd/qbl.xsd" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="QBL_Envelope" type="QBL_Envelope_Type" xdb:defaultTable="MYQBL"/>
         <xs:complexType name="QBL_Envelope_Type">
         <xs:sequence>
                   <xs:element ref="Transmission_Date" minOccurs="0"/>
                   <xs:element ref="QBL" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    <xs:element name="Transmission_Date" type="xs:string"/>
    <xs:element name="QBL">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="QBL_Number"/>
                        <xs:element ref="Priority"/>
                        <xs:element ref="Date_Prepared"/>
                        <xs:element ref="Line_Item" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="QBL_Number" type="xs:string"/>
    <xs:element name="Priority" type="xs:string"/>
    <xs:element name="Date_Prepared" type="xs:string"/>     
         <xs:element name="Line_Item">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Item_Name" maxOccurs="unbounded"/>
                        <xs:element ref="Line_Item_Weight"/>
                        <xs:element ref="Line_Item_Cube_Info"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Line_Item_Cube_Info">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Line_Item_Cube" minOccurs="0"/>
                        <xs:element ref="Line_Item_Cube_Qualifier" minOccurs="0"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Line_Item_Cube" type="xs:string"/>
    <xs:element name="Line_Item_Cube_Qualifier" type="xs:string"/>
    <xs:element name="Item_Name" type="xs:string"/>
         <xs:element name="Line_Item_Weight" type="xs:string"/>
    </xs:schema>
    insert into MYQBL values(
    xmltype('<QBL_Envelope>
         <Transmission_Date>030531</Transmission_Date>
         <QBL>
              <QBL_Number>316180J2</QBL_Number>
              <Priority>3</Priority>
              <Date_Prepared>20030530</Date_Prepared>
              <Line_Item>
                   <Item_Name>FREIGHT ALL KINDS</Item_Name>
    <Item_Name>Specail Item</Item_Name>
                   <Line_Item_Weight>0000212</Line_Item_Weight>
                   <Line_Item_Cube_Info>
                        <Line_Item_Cube>31.1</Line_Item_Cube>
                        <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
                   </Line_Item_Cube_Info>
              </Line_Item>
    <Line_Item>
                   <Item_Name>AAAAAA</Item_Name>
    <Item_Name>BBBBBBBB</Item_Name>
                   <Line_Item_Weight>0000512</Line_Item_Weight>
                   <Line_Item_Cube_Info>
                        <Line_Item_Cube>67.1</Line_Item_Cube>
                        <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
                   </Line_Item_Cube_Info>
              </Line_Item>
    </QBL>
    </QBL_Envelope>').createSchemaBasedXML('http://10.0.1.233:8080/home/cpa/xsd/qbl.xsd'));
    My question is how to select
    /QBL_Envelope/QBL/QBL_Number,
    /QBL_Envelope/QBL/Line_Item/Item_Name,
    /QBL_Envelope/QBL/Line_Item/Line_Item_Weight,
    /QBL_Envelope/QBL/Line_Item/Line_Item_Cube_Info/Line_Item_Cube
    /QBL_Envelope/QBL/Line_Item/Line_Item_Cube_Info/Line_Item_Cube_Qualifier
    in a select stetament? (Note that these elements QBL_Number, Line_Item and Item_Name have maxOccurs="unbounded") actually I want to use the select statement to create a view.
    I tried the following select statement and it works fine:
    select extractValue(value(b), '/QBL/QBL_Number'),
    extractValue(value(b), '/QBL/Priority'),
    extractValue(value(b), '/QBL/Date_Prepared')
    from egbl e, table(xmlsequence(extract(value(e), '/QBL_Envelope/QBL'))) b
    Please advise. It is import to us. Thank you for your help in advance!!!
    The database version is 9.2.0.3.0 and the operating system is Windows 2000.
    Thanks,
    Mary Wu

    Hi Mark,
    Thank you for your reply and I really appreciate!
    I tried the select statement you gave me but I got error:
    SQL*Plus: Release 9.2.0.3.0 - Production on Fri Aug 1 09:11:03 2003
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL> set long 10000;
    SQL> set pagesize 10000
    SQL> select * from myqbl;
    SYS_NC_ROWINFO$
    <QBL_Envelope>
    <Transmission_Date>030531</Transmission_Date>
    <QBL>
    <QBL_Number>316180J2</QBL_Number>
    <Priority>3</Priority>
    <Date_Prepared>20030530</Date_Prepared>
    <Line_Item>
    <Item_Name>FREIGHT ALL KINDS</Item_Name>
    <Item_Name>Specail Item</Item_Name>
    <Line_Item_Weight>0000212</Line_Item_Weight>
    <Line_Item_Cube_Info>
    <Line_Item_Cube>31.1</Line_Item_Cube>
    <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
    </Line_Item_Cube_Info>
    </Line_Item>
    <Line_Item>
    <Item_Name>AAAAAA</Item_Name>
    <Item_Name>BBBBBBBB</Item_Name>
    <Line_Item_Weight>0000512</Line_Item_Weight>
    <Line_Item_Cube_Info>
    <Line_Item_Cube>67.1</Line_Item_Cube>
    <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
    </Line_Item_Cube_Info>
    </Line_Item>
    </QBL>
    </QBL_Envelope>
    SQL> select extractValue(value(q), '/QBL/QBL_Number'),
    2 extractValue(value(q), '/QBL/Priority'),
    3 extractValue(value(q), '/QBL/Date_Prepared'),
    4 extractValue(value(n), '/Item_Name'),
    5 extractValue(value(l), '/Line_Item/Line_Item_Weight'),
    6 extractValue(value(l), '/Line_Item/Line_Item_Cube_Info/Line_Item_Cube'),
    7 extractValue(value(l), '/Line_Item/Line_Item_Cube_Info/Line_Item_Cube_Qualifier')
    8 from MYQBL e,
    9 table (xmlsequence(extract(value(e), '/QBL_Envelope/QBL'))) q,
    10 table (xmlsequence(extract(value(q), '/QBL/Line_Item'))) l,
    11 table (xmlsequence(extract(value(l), '/Line_Item/Item_Name'))) n;
    select extractValue(value(q), '/QBL/QBL_Number'),
    ERROR at line 1:
    ORA-00904: "SYS_NT0jPUiVR5SS6VqgqEvU1LkQ=="."SYS_NC_ROWINFO$": invalid
    identifier
    SQL>
    Do you have any idea about it?
    Actually before I posted the message I had tried the same select statement and had got the same error.
    Again, thank you very much and I really appreciate your help.
    Mary Wu

  • Very simple question-how to fill a shape I draw with color

    hi. I am new to photoshop and having a lot of trouble selecting any shape that I draw. I am trying to do a tutorial that involves filling a canvas with gray, then drawing a smaller white rectangle inside of the larger gray canvas/rectangle. (I did not forget to unlock the background).
    My question: how do i select and fill (with white) the second rectangle I draw on top of the larger gray rectangle???
    In general, I cannot figure out how to select and/or fill any shape I draw using the rectangle tool. Likewise, the marque shape tools are no help as I cannot seem to draw a marque on my gray rectangle in order to select it and fill it with a white fill. I have also tried to use a "fill layer."
    I am almost certain that something is wrong with my computer(I reset the settings), but then again I have not used photoshop in over a year. Any help  will be greatly appreciated.

    The Rectangle Tool sgould create a Work Path, Shape Layer or Fill Pixels according to the Settings in the Options Bar.
    The Rectangular Marquee Tool should create a Selection, which you could Edit > Fill or use as a Layer Mask for a Solid Color Layer.
    Could you please post a screenshot with the pertinent Panels visible?

  • UDF question - how detect a non existing sender element

    Hi all,
    i have a question according UDF. I have a sender message that contains a field, that sometimes has a content ans some time not. If no content then als the element doesn't exists (occurrence 0...1). The target element of this one has the occurrence status 1.
    So i have to create a function, that writes an empty string in case of no sender element. I know that i can configure this function with the MM Blocks (if exists ...). But for re-using reasons i'd like to create a UDF for this function.
    Now my question, how can i detect if no data in the sender (src) file?
    Here my try, which doesn't works:
    AbstractTrace trace = container.getTrace();
    trace.addInfo("container: "container);+
    trace.addInfo("iData: "iData);+
    if(iData == null){
    +     trace.addInfo("NO ELEMENT found!");+
    if(container == null){
    +     trace.addInfo("NO container found!");+
    if(iData.length() < 1){
    +     trace.addInfo("Empty or No element found - insert empty entry (space)");+
    +     return " ";+
    return iData;
    Thanks in advance
    Michael

    Hi Michael,
    Create a UDF of type value,
    Suppose in is the input and out is output of UDF..
    Then Code as follows:
    if(in==null)
       out = " Empty String Found ";
    else
       out = in ;
    return out;
    Use this code...and get ur problem solved!!!
    Regards,
    AshwinM
    [Dont forget to mark the answer]

  • How to select multiple records in ALV with out pressing ctrl

    Hi Experts,
    Is there a way to select multiple records in ALV with out pressing ctrl button on the key board?
    Selection and deselection should allow multiple records.
    any clue is highly appreciated.
    regards,
    Ajay

    The keyboard always plays a role, although with the Shift key you can select blocks of records.
    ○       CTRLclick, CTRLspacebar
    Toggles a selection.
    ○       SHIFTclick, CTRLshift
    Selects the area from the lead selection to the row selected. If no lead selection is set, the selection starts from the first row. In the multiNoLead mode, the selection starts from the row last selected

  • How do I delete photos in elements with out deleting them from my folders ?

    I am new to adobe. How do I delete images from elements 12 with out deleting them from my folders. ?

    When you select files to delete from catalog you get a dialog asking if you want to delete ALSO from disk : you don't. Simply don't check the check box.

  • Basic  XML Publisher Question: How to access tags in the higher levels?

    Hi All,
    We have a basic question in XML Publisher.
    We have a xml hierarchy like below:
    <CD_CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 1</CAT_NAME>
    <CD>
    <TITLE>TITLE1 </TITLE>
    <ARTIST>ARTIST1 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE2</TITLE>
    <ARTIST>ARTIST2 </ARTIST>
    </CD>
    </CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 2</CAT_NAME>
    <CD>
    <TITLE>TITLE3 </TITLE>
    <ARTIST>ARTIST3 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE4</TITLE>
    <ARTIST>ARTIST4 </ARTIST>
    </CD>
    </CATALOG>
    </CD_CATALOG>
    We need to create a report like below:
    CATALOG_NAME     CD_TITLE     CD_ARTISTCATALOG 1     TITLE1     ARTIST1
    CATALOG 1     TITLE2     ARTIST2
    CATALOG 2     TITLE3     ARTIST3
    CATALOG 2     TITLE4     ARTIST4
    So we have to loop at the level of <CD> using for-each CD. But when we are inside this loop, we cannot access the value of CAT_NAME which is at a higher level.
    How can we solve this?
    Right now, we are using the work-around of set_variable and get_Variable. We are setting the value of CAT_NAME inside an outer loop, and using it inside the inner loop using get_variable.
    Is this the proper way to do this or are there better ways to do this? We are running into troubles when the data is inside tables.

    you can use
    <?../CAT_NAME?>copy past to your template
    <?for-each:CD?> <?../CAT_NAME?> <?TITLE?> <?ARTIST?> <?end for-each?>

  • How to select a range of integer?

    Do anybody know how to use one select statement to make a range of number from 1.. 100?
    result set like:
    1
    2
    3
    4
    99
    100

    SQL> select count(*) 
      2  from all_objects
      3  where owner = 'SYS';
     COUNT(*)
         2016
    SQL> select rownum rn from
      2  (select 1 from dual
      3  group by cube (0,0));
           RN
            1
            2
            3
            4
    SQL> 
    Second query return 2**N rows (N is a number of 0 in cube(..)).
    See also Oracle Magazine "Turning On Pivot Tables".
    http://otn.oracle.com/oramag/oracle/02-sep/o52sql.html

  • How to Select a range instead of the whole row in Excel? ie a to k, m to z, VBA Code Below.

    Sub CopyPasteEntries()
    Dim i, g, h As Integer
    i = 2
    Sheets("Sheet1").Select
    Do Until IsEmpty(Cells(i, 1))
        i = i + 1
    Loop
    g = i - 1
    h = 2
    For i = 2 To g
        Sheets("Sheet1").Select
        If Cells(i, 1).Value <> "Created" Then 'first cell
            Cells(i, 1).EntireRow.Copy
            Sheets("Sheet2").Select
            Cells(h, 1).Select
            ActiveCell.PasteSpecial xlPasteAll
            h = h + 1
        End If
    Next
    Application.CutCopyMode = False
    End Sub

    Instead of
    Cells(i, 1).EntireRow.Copy
    use any of these
    Cells(i, 1).Resize(1,11).Copy  'A to K
    Intersect(Cells(i,
    1).EntireRow, Range("A:K")).Copy
    Range(Cells(i, 1), Cells(i,11)).Copy
    Range(Cells(i, "A"), Cells(i,"K")).Copy
    Range("A" & i & ":K" & i).Copy
    Cells(i, 1).Range("A1:K1").Copy

  • How to select date range 01/01/2007 to till date in info package selection

    HI
    I have a business requirement like i have to load data from 01.05.2007 to till date daily and the the till date should change daily when we are scheduling it daily.
    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = 'KDAY'.
              l_idx = sy-tabix.
              L_T_RANGE-IOBJNM   =      '/BI0/0CALDAY'.
              L_T_RANGE-FIELDNAME  =   'KDAY'.
              L_T_RANGE-SIGN      =     'EQ'.     
             L_T_RANGE-OPTION      =  '<>'.
              L_T_RANGE-LOW          = '01.05.2007'.
              L_T_RANGE-HIGH        =   'sy-datum'.
              modify l_t_range index l_idx.
    l_idx = sy-tabix.

    Hi,
    try to debug that one by putting a <b>break-point</b>.
    there is a reply from A.H.P , how to debug the routine in the infopackage.
    put a loop on the routine,
    data : debug(1).
    do.
    if debug = 'X'.
    exit.
    endif.
    enddo.
    and when run infopackage, go to sm50,
    on that process, menu program->debug program,
    in debug screen, type in debug, and fill with X and click 'edit'-pencil icon.
    F5 to next step.

  • An XML Scheme question - How to express a tag in XSD

    Hi.
    I'm trying to write an XSD to a certain XML (the CD_CATALOG famous example..), which has this kind of tag, which can appear in two formats:
    <PRICE value="34.9"/>
    or
    <PRICE>45.45</PRICE>
    the following expression just won't do, for it won't allow the first format.
    <xs:element name="PRICE">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:decimal">
    <xs:attribute name="value" type="xs:decimal"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    Please Please tell me if you have any Idea..
    Guy

    Could you not add a xs:choice element, like this:
      <xs:complexType>
            <xs:choice>
                <xs:element name = 'price'>
                    <xs:complexType>
                        <xs:attribute name = 'value' type = 'xs:decimal'/>
                    </xs:complexType>
                </xs:element>
                <xs:element name = 'price'>
                    <xs:simpleType>
                        <xs:restriction base = 'xs:decimal'/>
                    </xs:simpleType>
                </xs:element>
            </xs:choice>
        </xs:complexType>

  • How to select value from database view with * in wher clause

    Hi ,
      I ahve a database view with some fields.
    Now my requirement is to serach a single row on the basis of process type.
    Process type can have values like ZBA,ZBC,ZBD,ZBE or similarly anything starting with ZB.
    Now i know that starting two letters will be ZB , but dont knwo the last letter.
    So how should i use select query for the same?
    Should i use like operator for the same?
    regards
    PG

    hi,
    u can use character '%'.sample code like this
    SELECT reltype
                 instid_a
                 catid_a
                 instid_b
                 FROM /dbm/ord_docflow
                 INTO TABLE it_link
                 FOR ALL ENTRIES IN it_pnwtyh
                 WHERE  instid_a  =  it_pnwtyh-instid_a AND
                 instid_b  LIKE 'QMSM%'  AND
                 typeid_a  = 'BUS2400'  AND
                 typeid_b  = 'BUS2400' AND
                 catid_a   = 'BO' AND
                 catid_b   = 'BO' AND
                 reltype   = 'VONA'.
    this is similar to using* while we fetch values from table.in the above code only i no QMSM rest values not sure,so used QMSM%

Maybe you are looking for

  • Qosmio G30-194 What type of Vista (Home, Business or Ultimate)?

    I have two Qosmio G30. One at work (G30-153) and one at home (G30-194). I use both for working and also to play movies, games, etc. At work I use a domain. Please advise me about what version of Vista is better to use. I prefer to have the same versi

  • Update subtotals in purchase orders

    Dear All, We've recently made some changes in the subtotal assignment in the pricing schema. Is there any option by which we can update subtotals in the EKPO table as per the new settings in the schema?? Regards, Manoj.

  • My data comes up blank in PDF bank statements and employer W2s (ASP)

    When I try to download bank statements (actually, today it's my W2 form from ADP's craptastic "Payroll Work Center") an ASP file is downloaded to my desktop. It opens up in Prieview, but aside from the form itself, the data fields are blank. I've tri

  • Try to install openmotif21-2.1.30-11.EL5.i386.rpm dte eroor

    when try to install openmotif21-2.1.30-11.EL5.i386.rpm get this error [root@EBSS rpm]# rpm -ivh openmotif21-2.1.30-11.EL5.i386.rpm error: Failed dependencies: libXp.so.6 is needed by openmotif21-2.1.30-11.EL5.i386 and i don't have Linux unbreakable a

  • Airdrop not working fine

    I have a MBA with yosemite 10.10.1 installed & iPhone 5C 16 GB with iOS 8.1, But when I am trying to transfer the file its giving an error that the MBA has declined the request and same it happens with the iPhone too. I had a word with the technical