XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Jay DreyerSubject: 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.

Thanks for any help you can provide.

-Kaline

Postnext
(Deleted User) 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.

hope this help.


song

Postnext
Jay DreyerSubject: 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!

Thanks for your help...

-Kaline

Postnext
(Deleted User) 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}.

song

Postnext
Jay DreyerSubject: Tough mapping question...
Author: Jay Dreyer
Date: 09 Nov 2001 03:31 PM
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

Posttop
(Deleted User) Subject: RE: Tough mapping question...
Author: (Deleted User)
Date: 09 Nov 2001 03:52 PM
the following code might help: i assume root is :



xmlns:xsl="http://www.w3.org/1999/XSL/Transform">























> -----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
>
>

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.