Six Stars

Xml of Document type, returning from tHMap; best practice to remove empty tags?

tXmlMap has a checkbox item to remove empty tags; but tHMap (returnning from Mapper) doesn't seem to have this option.

What is the best practice case on a returned Document type from the tHMap, to remove empty tags?

Thanks

5 REPLIES
Moderator

Re: Xml of Document type, returning from tHMap; best practice to remove empty tags?

Hello,

We have redirected your issue to our data mapper expert and then come back to you as soon as possible.

Thank for your time.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Employee

Re: Xml of Document type, returning from tHMap; best practice to remove empty tags?

Hi,

 

You can set the structure's element to optional in TDMopt.png

 

 

 

 

 

 

 

If you map the structure like 
map.png
with the input

 

<?xml version="1.0" ?>
<Root>
  <b>
    <c>foo</c>
  </b>
  <b>
    <d>bar</d>
  </b>
</Root>

then the output will be also

<?xml version="1.0" ?>
<Root>
  <b>
    <c>foo</c>
  </b>
  <b>
    <d>bar</d>
  </b>
</Root>

 

Six Stars

Re: Xml of Document type, returning from tHMap; best practice to remove empty tags?

Thanks for the reply; I do see in the structure; when [Read Only] is selected; the Basic section which contains the option of Mandatory (default).
However, I do not see a way to edit this to be Optional (Nullable) on the basic section.

When I switch from [Read Only] to [Editiable] I do not see any selectable choices reflecting 'Mandatory' anymore; or anywhere to pick 'Optional'.
I do see a nullable checkbox; but that doesn't switch it from Mandatory to Optional.

Question 1) so what am I missing to edit this property to be optional?

 

 

Also 
A second question if you don't mind.
When I load a pre-defined xml structure; if a tag has attributes; then structure tree has Tag/Attribute/attribute tag in the tree format.
However, if I manually add a new tag; set it to be of type Xml Attribute; it does show with the Attribute icon; and shows to be an Attribute; but the word 'Attribute' doesn't appear in the tree structure between it and the root node.  Is this ok?  Seems odd.  Is this ok?

Attributes Tree Missing.PNG

Six Stars

Re: Xml of Document type, returning from tHMap; best practice to remove empty tags?

I found the answer to the Mandatory vs Optional; Setting the Occurs to 0 1 did the trick on a non-looping tag.

Still unsure why Attributes is missing from the tree on a added tag/attribute; and if it matters. (screencap above)

Employee

Re: Xml of Document type, returning from tHMap; best practice to remove empty tags?

Hi,

 

When an element's 'Visible Group' is unselected, then it will be disappeared