RE: Prevent empty element from appearing in output
From: Mike Watson (MikeWatson_at_discussions.microsoft.com)
Date: 11/25/04
- Next message: Bryan Brouckaert: "Re: Validation error importing schemas across different projects"
- Previous message: PAul Maskens: "Reverse engineering - Rescue system"
- In reply to: Phil Knight: "Prevent empty element from appearing in output"
- Next in thread: Bryan Brouckaert: "Re: Prevent empty element from appearing in output"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 25 Nov 2021 08:41:04 -0800
Hi Phil,
Set the following properties in your XSD.
Address : Min Occurs = 0
Line : Min Occurs = 0/ Max Occurs = * (unbounded)
PostCode : Min Occurs = 0
Country : Min Occurs = 0
In your map :
Add THREE ‘Logical Existences’ to your map and connect the source : ‘Line’,
‘PostCode’ and ‘Country’ to one of the functiods.
Add ONE ‘Logical OR’ functiod to your map. Connect all three outgoing
‘Logical Existences’ functiods to the ONE ‘Logical OR’. Connect the output of
your ‘Logical OR’ to the destination ‘Address’ node.
Now do a straight mapping from
Source ‘Line’ to destination ‘Line’
Source ‘PostCode’ to destination ‘PostCode’
Source ‘Country’ to destination ‘Country’
Generate a sample XML instance from the XSD and remove the ‘Line’,
‘PostCode’ and ‘Country’.
Attach this instance to your map and test it… You should now see that you do
not have the Address node… Then add one ‘Line’ element and test again. You
will see that there is a ‘Line’ node with a parent ‘Address’ node…
I hope that this helps.
Mike Watson
"Phil Knight" wrote:
> In BizTalk 2004, I have an input XML structure as follows -
>
> <Address/>
> <Line>line 1</Line>
> <Line>line 2</Line>
> <Line>line 3</Line>
> <Line>line 4</Line>
> <PostCode>postcode</PostCode>
> <Country>country</Country>
> </Address>
>
>
> I want to map this to an identical structure but with slightly different
> element names in a different schema. However, the Address element should only
> appear in the output if any of the child elements (Line, PostCode and
> Country) are present in the input. Similarly Line, PostCode and Country
> should only appear in the output if present in the input. I can get the last
> bit to work fine by linking each child element to a logical existence
> functoid and a Value Mapping functoid, but when all the fields are empty I am
> still getting an Address element, albeit an empty one, in my output XML. This
> is despite not having any links between the Address element in the input and
> the one in the output, so I can't understand why an empty element should be
> created.
>
> Can anyone give me some pointers on why this is and, more importantly, how
> to prevent the Address element from being output when the corresponding input
> record has no child content?
>
> Regards,
> Phil
- Next message: Bryan Brouckaert: "Re: Validation error importing schemas across different projects"
- Previous message: PAul Maskens: "Reverse engineering - Rescue system"
- In reply to: Phil Knight: "Prevent empty element from appearing in output"
- Next in thread: Bryan Brouckaert: "Re: Prevent empty element from appearing in output"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
- Re: Paging TomTom Navigator peeps
... >>> When selecting a location, can it done by methods other than a>>
postcode? ... >> Ideally I'd like to be able to point at some place on the map
as a>> destination, or maybe even enter the Lat/Long or Grid Ref. ... Select 'Set as destination'>
JD ... (uk.rec.motorcycles) - Re: GPS for Tungsten E
... one SD card slot. ... So if you insert a bluetooth card, you can't have a big
map since the memory is only 28Mb minus all softwares you have installed. ... You will
change your mind on Viamichelin ) during navigation which is not in Mapsonic but it's not so important.
... It's quite useful, I used it to set up a route avoiding two nearby cities to take me to a
motorway I need to use to access the rest of the country, avoiding rush hour traffic jams. ...
(uk.comp.sys.palmtops) - mapper - multiple loops to a single destination
... I am trying to find a way in the BizTalk 2004 mapper to do multiple ... certain
child nodes - all to the same destination node group in the ... where a specific child
node's value meets a condition, and then map one ... <B>Because the value of sibling
node A is 'TheOne', ... (microsoft.public.biztalk.general) - WEB Query + IMAGES
... Part of the project needs to get a map from multimap and return ... I have written
some code that uses a web query to ... obtain a link to the exact postcode location
within multi map where the ... Dim postcode ... (microsoft.public.excel.programming) - Re: maps...
... need to use multimap for destination. ... > You can see that the second
map is simply the first map with the key, ... The underlying tree structure of the
source is unrelated to the ... a class that keeps a pointer to the actual ... (comp.lang.cpp)