View previous topic :: View next topic
|
Author |
Message |
kiran_polnati Warnings : 2 New User
Joined: 23 Jun 2005 Posts: 22
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
kiran_polnati Warnings : 2 New User
Joined: 23 Jun 2005 Posts: 22
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
kiran_polnati Warnings : 2 New User
Joined: 23 Jun 2005 Posts: 22
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
|