Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: How to handle multiple buffers using PLISAXC ... please help
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: 2435
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 02, 2012 12:52 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us