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

how to use xml-schema while parsing xml in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kiran_polnati
Warnings : 2

New User


Joined: 23 Jun 2005
Posts: 22

PostPosted: Tue May 15, 2007 11:59 am
Reply with quote

hi

i know how to parse xml , but i need there is way to use the xml-schema while parsing xml in cobol .

ex: prioritigation , parent field s and child fields and blanks fields
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue May 15, 2007 2:32 pm
Reply with quote

Directly in COBOL, I don't think so.... I think, some how, you need to get into the JAVA services for that.
Back to top
View user's profile Send private message
kiran_polnati
Warnings : 2

New User


Joined: 23 Jun 2005
Posts: 22

PostPosted: Wed May 16, 2007 10:21 am
Reply with quote

Hi Thomson

while parsing xml , i will put the data into array dependingup on no of records coming var coming through xml data. depending up on no records the array should occurs n times .

how come to know the var no records

ex:
01 XML-REC PIC X(190) "<C><REC><NAME>AHI</NAME><AGE>23</AGE></REC><REC><NAME>TOM</NAME><AGE>28</AGE></REC><REC><NAME>BIL</NAME><AGE>36</AGE></REC><NREC>2</NREC></C>".

abouve example i should know the <nrec> values dependin up on the array should occurs

i did in xml handler

when "NREC"
MOVE XML-TEXT TO NO OF RECORDS
WHEN "REC"
SET R UP BY 1

but above every REC R UP BY 1 IT IS NOT CONSERNING THE ARRAY OF OCCURS TIMES

PLEASE HELPME
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed May 16, 2007 2:48 pm
Reply with quote

I'm sorry, I don't see a connection between your first post and your second.
I am having great dificulty understanding your last post.
Back to top
View user's profile Send private message
kiran_polnati
Warnings : 2

New User


Joined: 23 Jun 2005
Posts: 22

PostPosted: Wed May 16, 2007 3:26 pm
Reply with quote

hi william,


how can we put the xml data into array of elements

but this array occurs var1 times , as we comes to know that var1 was coming through xml data

ie <data>
<d1> </d1>
<d2> </d2>
</data>

above example <data> tag is repeated var1 no of times

the var1 no of times also comes through the xml data
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed May 16, 2007 3:53 pm
Reply with quote

Code:
<payment>
   <payinfo>
      <total$>5.2</total$>
   </payinfo>
   <iteminfo>
      <item#>1208</item#>
      <item$>.99</item$>
   </iteminfo>
   <iteminfo>
      <item#>1948</item#>
      <item$>3.52</item$>
   </iteminfo>
   <iteminfo>
      <item#>314159</item#>
      <item$>.69</item$>
   </iteminfo>
</payment>


When you get "payment", set the subscript to zero. Every time you get a new "iteminfo", increment that subscript and move the "item#" and "item$" to its entry in the table.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top