on 09-07-2005 3:52 PM
Hello All
I am trying to convert the XML file into the text file, my XML file is of the following structure...
<root>
<data>
<details>
</details>
<details>
</details>
-
-
-
</data>
<data>
<details>
</details>
<details>
</details>
-
-
-
</data>
<trailer>
</trailer>
</root>
into the following flat structure
<data><details><details>---
<data><details><details>---
<trailer>
for this i have done the following content conversion settings
Recordset Structure: data,details,trailer
data.addHeaderLine 0
data.fieldFixedLengths 1,8,6,8,8,1,3
data.endSeparator 'nl'
details.addHeaderLine 0
details.fieldSeparator ,
details.endSeparator 'nl'
trailer.addHeaderLine 0
trailer.fieldFixedLengths 1,3,6
trailer.endSeparator 'nl'
but actually i do not need the 'nl' for details.endSeparator, but i am not able to find out any other value which i could provide here, as default value is 'nl', i also do not want to "," for details.fieldseparatoe, but when i change this with fieldFixedLengths, i get the error
"Error: Message processing failed with java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '015')', probably configuration error in file adapter (XML parser error)'"
kindly help me in finding out the mistake i am doing...
Regards
Dheeraj
Hi Dheeraj,
>><i>but actually i do not need the 'nl' for details.endSeparator</i>
If you don't require the <b><i>endseparator</i></b> parameter then you can very well leave that, it is not a mandatory parameter. It is used to generate the Output File in a proper order.
>><i>i also do not want to "," for details.fieldseparator</i>
For this as Priyanka said, you can either use a 'Horizonatal Tab' or simply put some blank spaces.
But for the proper output, you will have to use the <i>fieldSeparator</i> parameter.
I hope if it helps, you'll give me points
Thanks & Regards,
Varun Joshi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys
thanks for your reply, but the problem is i want my out put in 1 line with no spaces, horizontal tab or new line, let me try and explain it in more detail...
my xml format...
<root>
<data>
<field1>f1</field1>
<details>
<detfield1>f1det1</detfield1>
<detfield2>f1det2</detfield2>
</details>
</data>
<data>
<field1>f2</field1>
<details>
<detfield1>f2det1</detfield1>
<detfield2>f2det2</detfield2>
</details>
</data>
<trailer>
<count>2</count>
</trailer>
</root>
my output file should look like this...
f1f1det1f1det2
f2f2det1f2det2
2
Dheeraj
hi Dheeraj,
I feel you handle this situation in mapping by creating the reciever structure similar to given below.
<root>
<data>
<field1/>
<detfield1/>
<detfield2/>
</data>
<trailer>
<count/>
</trailer>
<root>
<field1/> <detfield1/> <detfield2/> are at the same level children of <data>
Map the occurence of <data> element (target structure) per occurence of <data> element(sender XML structure)
By content conversion you will be able the desired output.
Now you have 2 record set structure
Data and trailer.
Hope it helps,
cheers,
Satish
Hi Dheeraj,
You could use '0x09' for horizontaltab instead of 'nl'.
Regards
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.