Subject:Tough mapping question... Author:Jay Dreyer Date:09 Nov 2001 01:06 PM
Hi all,
I like the tool a lot, so far. If I can find an answer to this problem, I'll love it!
I'll try to make this simple. I'm trying to map one xml file to another.
The first one contains the results of a html form submission.
The second one is how the data is expected to appear.
The mapping is simple up to this point:
I have a couple different sets of repeating data like:
phoneArea0
phoneNumber0
phoneArea1
phoneNumber1
etc.
Each of these "groups" need to become its own section in the mapped-to xml file:
phone
phoneArea
phoneNumber
/phone
(repeat for each group)
The number of groups could be 0,1 or more.
Is there any possible way to do this or am I crazy??? I haven't figured it out from the tool yet.
Subject:Tough mapping question... Author:(Deleted User) Date:09 Nov 2001 02:47 PM
if it is doable in mapper depends on the nature of your source xml file. since you mentioned you have a couple of diffrent set of repeating {phoneArea} and {phoneNuber}, I assume you have a limited {phoneArea} in your source, say the maximum is {phoneArea10}. in this case, you simplely need to right click on {phone} node in destination and duplicate 10 times, you will have 10 more repeating {phone} element in destination tree. then you just need to map the left to right one by one, you are all set.
if the number of {phoneArea} is undefinite which require you to write a generic algorithm to handle every pair of and {phoneNumber}, then mapper can't do that, you have to write xslt code for it.
Subject:Tough mapping question... Author:Jay Dreyer Date:09 Nov 2001 02:55 PM
Hmmmm...I was afraid of that. I've got an undefined number of phone groups. Could be 0, could be....?
Any idea where I can find some sample xslt code to get me started? Haven't had much luck finding it yet, although I'm not sure what exactly I'm looking for!
Subject:Tough mapping question... Author:(Deleted User) Date:09 Nov 2001 03:21 PM
can you tell me if your {phoneArea} and {phoneNumber} always comes in pair in your source xml docuemnt. i mean {phoneArea_n} is fllowed by {phoneNumber_n}.
> -----Original Message-----
> From: stylus-studio-xslt Listmanager [mailto:listmanager]
> Sent: Friday, November 09, 2001 3:39 PM
> To: Recipients of 'stylus-studio-xslt' suppressed
> Subject: Tough mapping question...
>
>
> From: "Jay Dreyer"
>
> Yes. They always follow each other. There are actually 5
> items in the group but all of the 1's are together, followed
> by the 2's, etc.
>
> phonetype0
> phonearea0
> phonenum0
> phoneext0
> phonenote0
>
> phonetype1
> phonearea1
> phonenum1
> phoneext1
> phonenote1
>
> etc.
>
> Thanks,
> -J
>
>
>
> To reply: mailto:stylus-studio-xslt.4055@edn.exceloncorp.com
> To start a new topic: mailto:stylus-studio-xslt@edn.exceloncorp.com
> To login: http://edn.exceloncorp.com/~SSDN
>
>