IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to handle multiple buffers using PLISAXC ... please help


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
princegaurav

New User


Joined: 08 Dec 2005
Posts: 9

PostPosted: Thu Aug 02, 2012 11:15 am
Reply with quote

Hi ,
I have huge XML string of 2GB . I want to parse it using PLISAXC . The input is provided as pointer to
DCL 1 Input based (inpptr),
2 Data(64) char (32767);

I call the PLISAXC with the addr(Data(1)) and length(Data1). The 1st element is parsed however when I assign the address and length of next element in END_OF_INPUT event to addr_xml and length_xml .

The parser returns subsequent blank string . I checked using Debugger, if the xmltoken in the parser is assigned the new address. To my surprise it had the old value .


Can any one help me as how the memory address is passed in PLISAXC for huge data .


Thanks in advance.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 02, 2012 12:52 pm
Reply with quote

Maybe you show the relevant code/declarations.
Back to top
View user's profile Send private message
princegaurav

New User


Joined: 08 Dec 2005
Posts: 9

PostPosted: Thu Aug 02, 2012 1:39 pm
Reply with quote

This is the sample code that i was testing before handling the 2GB XML.
Here I took and array of character length(100) .

I get the parsed value for xmlarray(1) properly however for rest of the element are blank .... not sure if the length is proper .

test: proc (inpxml,outxml) options(reentrant,fetchable) reorder;

dcl xmlarray(04) char(100) init(' ');

xmlarray(1) =
'<?xml version="1.0" standalone="yes"?>'
!! '<!--This document is just an example-->'
!! '<sandwich>';
xmlarray(2) = trim(
'<bread type= "baker s best"/>'
!! '<?spread please use'
!! 'real mayonnaise ?>');
xmlarray(3) = trim(
'<meat>Ham &amp; turkey</meat>'
!! '<filling>Cheese, lettuce, tomato, etc </filling>' );
xmlarray(4) = trim(
'<![CDATA[We should add a <relish> element in future!]]>'
!! '</sandwich>'
!! ' ');

p = addr(xmlarray);

call plisaxc (eventHandler,
addr(token),
addr(xmlarray(i)),
length(xmlarray(i)));
end test ;

dcl ptr1 pointer init(null);
dcl chars(04) char(100) based (ptr1);
dcl i fixed bin(31) init(1);

start_of_document: proc(userToken)
returns( byvalue fixed bin(31) )
options( byvalue linkage(optlink) );
return(0);
end;
.......
/* I have only modified end_of_input */
end_of_input: proc( userToken, addr_xml, length_xml )
returns( byvalue fixed bin(31) )
options( byvalue linkage(optlink) );

dcl userToken pointer;
dcl addr_xml byaddr pointer;
dcl length_xml byaddr fixed bin(31);

i += 1;
if (i<=4) then do ;

addr_xml = addr(Chars(i)) ;
length_xml = length(chars(i));

return(0);
end;

end;


/****** output *****/
start_of_documentLength = 0.00000E+00
1.0........yes0...........This document is just an example0...........sandwich..
1.0
version_information <1.0>
standalone_declaration <yes>
comment <This document is just an example>
start_tag_of_element <sandwich>
tag_content_characters < >
!!flags = 11000000
Chars(2)
tag_content_characters <>
!!flags = 01000000
start_tag_of_element <read.>
attribute_name <yonn>
attribute_characters < >
end_tag_of_element < >
processing_instruction <......>
tag_content_characters <..................................>
!!flags = 11000000
Chars(3)
tag_content_characters <>
!!flags = 01000000
start_of_cdata
tag_content_characters <...........................................>
end_of_cdata
end_tag_of_element <........>
end_of_document
Back to top
View user's profile Send private message
princegaurav

New User


Joined: 08 Dec 2005
Posts: 9

PostPosted: Thu Aug 02, 2012 4:04 pm
Reply with quote

If I get some clue how to use multiple buffers in PLISAXC will also be useful .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top