Page 1 of 1

Hierarchy stage <element/> tags

Posted: Mon Dec 03, 2018 11:45 am
by sainath
Hi

In hierarchy stage where can I select the format of the output


I am getting the following one if input is null


<element-name/>

but I want

<element_name>/<element-name>

I tried to change in XSD no luck

please help

Posted: Mon Dec 03, 2018 12:59 pm
by eostic
The two are equivalent, assuming you mean <element> </element>

Posted: Mon Dec 03, 2018 1:47 pm
by sainath
HI

I mean the below format.how can I achieve this using hierarchy stage
<element> </element> ..


thks

Sainath

Posted: Tue Dec 04, 2018 1:07 am
by ray.wurlod
Don't try to force the stage (or any stage) to do what it's not designed to do. There are plenty of XML formatters out there; many of them are free. Use the right tool for the job.

Posted: Tue Dec 04, 2018 4:06 am
by eostic
This is a good discussion....

XML, as a standard ,supports two similar methods for indicating an "empty" element.

<element/>

and

<element></element>

Both are entirely equivalent --- the mean the same thing. Some have argued in the past that one is more readable than the other...and certainly, the top one is a lot more efficient, making the payloads MUCH smaller, in large documents with hundreds of elements and the potential that a large majority of them are empty.

But --- either way, a valid xml parser on the receiving end should NOT care. ...and if it does, it is time to have it updated. These debates about empty elements were very active and valid --- in 2001....but now? Hardly.

That being said, the xmlOutput Stage provides the option (it was written in 2001) for your choice of empty element. The Hierarchical Stage gives you the option of whether you want the element at all (if null, you can choose to have no element sent to the final document). [xmlOutput can do this too, but it is a matter of how you specify nullability as opposed to an option in the GUI].

Bottom line -- the receiver should be able to handle this entirely valid xml construct, regardless of how it is output...

If not, and your xml is fairly simple, you could use the older xmlOutput stage to accomplish what you are looking for.

Ernie