Author |
Message
|
neo_revolution |
Posted: Mon Feb 23, 2004 10:34 am Post subject: Output XML |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
Hi,
I am trying to create output XML tree from a XML input.
My code reads something like this
SET myOutXML.outHeader1.outBody.outField1.outValue =
myInXML.inHeader1.inBody.inField1.inValue;
The problem I am facing is that if
insubfield1 = NULL
my output XML reads something like this
<myOutXML>
<outHeader1>
<outBody>
</outField1>
</outBody>
</outHeader1>
</myOutXML>
if you see it is creating the parent "</outField1>" if the input value is null
Is there anyway we can avoid creating the parent closing tag if the field value is null
Thanks. |
|
Back to top |
|
 |
Missam |
Posted: Mon Feb 23, 2004 11:02 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Are you sure whether your input field is NULL or EMPTY STRING |
|
Back to top |
|
 |
neo_revolution |
Posted: Mon Feb 23, 2004 11:46 am Post subject: |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
actually its creating <outField1/> as output tag...
my input value is null |
|
Back to top |
|
 |
Missam |
Posted: Mon Feb 23, 2004 12:17 pm Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
If you have an Input XML Element without Data in it(Tags Exist with no Data).You will get an Empty tag as output,what you are seeing exactly as in your case.
Input or Output Element NULL means you won't even see tags.
If you don't want to see empty tags in your output, you need to handle it before constructing the output element. |
|
Back to top |
|
 |
neo_revolution |
Posted: Mon Feb 23, 2004 12:41 pm Post subject: |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
I figured out that... I need to handle it before creating the output tree... Thanks |
|
Back to top |
|
 |
|