Search the web
Sign In
New User? Sign Up
xml-dbms
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Use of InlineMap Element   Message List  
Reply | Forward Message #3856 of 3867 |
Re: Use of InlineMap Element

Thank you for your reply Ron.

Actually, my problem is there is no parent-child relationship between storedHU
and dataSource. Also, there are many such elements (like dataSources) having
size as their attribute.

Is there any way by which this can be accomplished?

Thanks.
Ruchika Israni

--- In xml-dbms@yahoogroups.com, Ronald Bourret <rpbourret@...> wrote:
>
> Hello,
>
> Yes, you can use the InlineMap element for this.
>
> For example, the ClassMap element for storedHU would look something like
> this:
>
> <ClassMap>
> <ElementType Name="storedHU" />
> <ToClassTable Name="STOREDHUTABLE" />
> ... PropertyMap elements for lastSaved, creator, method, version ...
> <InlineMap>
> <ElementType Name="dataSources" />
> <RelatedClass KeyInParentTable="Unique">
> <ElementType Name="dataSource" />
> <UseUniqueKey Name="..." />
> <UseForeignKey Name="..." />
> </RelatedClass>
> </InlineMap>
> <RelatedClass KeyInParentTable="Unique">
> <ElementType Name="hermUnit" />
> <UseUniqueKey Name="..." />
> <UseForeignKey Name="..." />
> </RelatedClass>
> </ClassMap>
>
> The InlineMap element tells XML-DBMS to ignore the dataSources element
> and treat its children and attributes as if they were part of the
> storedHU element. This would be the same as mapping the following XML:
>
> <storedHU ...other attributes... size="2" >
> <hermUnit ...other attributes... />
> <coAuthors>
> <coAuthor name="coAuthor1"></coAuthor>
> </coAuthors>
> <dataSource id="1" loc="..." mime="..." />
> <dataSource id="2" loc="..." mime="..." />
> ...
>
> Notes:
>
> 1) The dataSources/@size attribute is treated as if it were an attribute
> of storedHU. If you wanted to map it to a column in the STOREDHUTABLE,
> you would do this with a PropertyMap element inside the InlineMap element.
>
> 2) You can also use the InlineMap element to ignore the coAuthors element.
>
> 3) You will need a ClassMap element for the dataSource element.
>
> Hope this helps,
>
> -- Ron
>
> Ruchika Israni wrote:
> > Hi Ron,
> >
> > I want to skip certain elements in my xml because they do not correspond to
any structure in the database and map the child to a table in the database. I am
not sure whether or not that can be done with the InlineMap tag. Here is the
partial structure of my xml :
> > ************************************************************
> > <?xml version="1.0" encoding="utf-8" ?>
> > <storedHU xmlns:aml="http://www.atlasti.com/hu/ns2003"
> > lastSaved="2008-09-15T14:28:34" creator="ATLAS.ti" method="AML (ATLAS Markup
Language)" version="WIN 5.2 (Build 0)">
> >
> > <hermUnit name="masterFLOSSFireandGaimHU09072008" au="Super"
cdate="2007-06-18T20:20:52" mdate="2008-09-08T22:36:17" lastPD="816"
prot="private" />
> > <coAuthors>
> > <coAuthor name="coAuthor1">
> > </coAuthor>
> > </coAuthors>
> >
> > <dataSources size="2" >
> > <dataSource id="1"
loc="&lt;HUPATH&gt;\FLOSS\Docs\gaim-sample\gaim-2004-06-23-18-10-00-37-3216.txt"
mime="text/plain" />
> > <dataSource id="2"
loc="&lt;HUPATH&gt;\FLOSS\Docs\gaim-sample\gaim-2006-01-26-04-30-00-37-7064.txt"
mime="text/plain" />
> > </dataSources>
> > **************************************************************
> >
> > In the above xml, storedHU and hermUnit correspond to their respective
tables. There is no table corresponding to the dataSources element however, I
want to insert data into the datasource table in the database. Is there any way
by which this can be done? I went through the FAQs and related posts in the
group and accordingly tried to play around with the <InlineMap> tag. However, no
avail.
> >
> > Any help in this regard would be appreciated.
> >
> > Many thanks in anticipation.
> >
> > Ruchika Israni
> >
> >
> >
> > ------------------------------------
> >
> > To post a message, send it to: xml-dbms@yahoogroups.com
> > To unsubscribe, send a blank message to: xml-dbms-unsubscribe@...! Groups
Links
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> >
> > No virus found in this incoming message.
> > Checked by AVG - www.avg.com
> > Version: 8.5.339 / Virus Database: 270.12.40/2135 - Release Date: 05/26/09
08:53:00
> >
>





Mon Jun 1, 2009 11:40 pm

israniruchika
Offline Offline
Send Email Send Email

Forward
Message #3856 of 3867 |
Expand Messages Author Sort by Date

Hi Ron, I want to skip certain elements in my xml because they do not correspond to any structure in the database and map the child to a table in the database....
Ruchika Israni
israniruchika
Offline Send Email
May 26, 2009
4:52 pm

Hello, Yes, you can use the InlineMap element for this. For example, the ClassMap element for storedHU would look something like this: <ClassMap> <ElementType...
Ronald Bourret
xmldbms
Offline Send Email
May 28, 2009
5:42 am

Thank you for your reply Ron. Actually, my problem is there is no parent-child relationship between storedHU and dataSource. Also, there are many such elements...
Ruchika Israni
israniruchika
Offline Send Email
Jun 1, 2009
11:40 pm

Hello, 1) If you can, you should redesign your XML so that dataSources is not a child of storedHU. The current design is misleading, as it implies a ...
Ronald Bourret
xmldbms
Offline Send Email
Jun 2, 2009
5:56 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help