XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] XML into a database

Hi Stephen,

Thanks very much for your effort and time in creating a schema for me  
but it has not made a difference.

I can still only map the last attributes of an element to a field in  
my database.

For example, there are two attributes of country that are listed in  
the XML file, when viewing it in XML Spy:

<country displaysize="1_0">
		<attributes>
			<attribute>
				<attribute-name contextual="YES">CountryName</attribute-name>
				<attribute-value view="G">Italy</attribute-value>
			</attribute>
			<attribute>
				<attribute-name contextual="NO">CountryCode</attribute-name>
				<attribute-value view="none">I</attribute-value>
			</attribute>
		</attributes>

However, when you import the XML file with its schema into MapForce I  
can only map the country code, in other words only the last attribute  
of an element is being shown:

- country
	- attributes
		- attribute
			- attribute-name
			- attribute-value

Now it could be something I'm not doing in MapForce, so excuse me if  
it is.

Cheers
David Bradley
Senior Web Programmer
Globe Media
Brookfields Way
Manvers
Wath-upon-Dearne
Rotherham
S63 5DL

Tel: 01709 768231
Fax: 01709 768011
dave@globe-media.com
www.globe-media.com


On 11 Jun 2007, at 19:50, Stephen Green wrote:

> Hi David
>
> Maybe this schema will work - attached - with compliments :-)
>
>
> -- 
> Stephen Green
>
> Partner
> SystML, http://www.systml.co.uk
> Tel: +44 (0) 117 9541606
>
> http://www.biblegateway.com/passage/?search=matthew+22:37 .. and voice
>
>
> On 11/06/07, David Bradley <dave@globe-media.com> wrote:
>> Hi,
>>
>> I've downloaded XMLSpy and MapForce.
>>
>> I've had to create an XML Schema using the 'Generate Schema' function
>> in XMLSpy because MapForce doesn't allow you to import an XML file
>> without a Schema or DTD.
>>
>> However, when I import the XML file into MapForce, not all the values
>> in XML file appear to allow me to map them to files in the database.
>> Now this is probably due to the way the XML tags have been named.
>>
>> Would anyone have any ideas on how I can get all the tags to show.
>>
>> Just to say my XML knowledge is very limited. I did try to create my
>> own schema, but with no luck.
>>
>> Regards
>>
>> David Bradley
>> Senior Web Programmer
>> Globe Media
>> Brookfields Way
>> Manvers
>> Wath-upon-Dearne
>> Rotherham
>> S63 5DL
>>
>> Tel: 01709 768231
>> Fax: 01709 768011
>> dave@globe-media.com
>> www.globe-media.com
>>
>>
>>
>>
>> On 7 Jun 2007, at 00:30, Stephen Green wrote:
>>
>> > Hi David
>> >
>> > Thanks :-)
>> > Personally I use Stylus Studio. I use a version which
>> > deosn't have XML to database mapping but it works quite
>> > nicely for XSLT if you are new to it. I learnt XSLT
>> > with it using its mapping facilities to map between
>> > schemas so I'd be confident it would suit me to map
>> > to a database / SQL.
>> >
>> > I also use XML Spy which in certain versions has tools
>> > I think which could be useful for this. If you don't
>> > mind the expense then there's Altova's Map Force too
>> > which looked cool when I tried an evaluation copy. In
>> > fact, just looking at XML Spy Pro 2007 I see it lets
>> > you do what Access does but to map to an existing
>> > Database (which is what you seem to need to do having
>> > designed your database manually perhaps) it asks you
>> > to buy MapForce.
>> >
>> > All of these have evaluation copies and they really
>> > should be tried before being bought as they are quite
>> > costly (by my standards/means anyway).
>> >
>> > Still I love them and find them solidly useful if you
>> > have a fair bit of this sort of work to do. Map Force
>> > probably comes closest but a version of Stylus Studio
>> > with the functions you need (I think there is one -
>> > you'd have to check it out) might be more user friendly
>> > (at least I thought so when starting to do mappings
>> > though at that time Map Force wasn't around). Really
>> > it's a matter of choice between these two main players
>> > but both can probably do what you need, happily, and
>> > give you some fun in doing it too :-) But cost you a
>> > bit for the easy ride - until you get the hang of
>> > XSLT so much you don't need them perhaps :-) If you
>> > don't have Windows you might need to check out whether
>> > a version of Oxygen does the same thing (but I've
>> > never used it).
>> >
>> > Happy mapping
>> >
>> > Steve
>> >
>> >
>> >>>> David Bradley <dave@globe-media.com> 06/06/07 13:17 PM >>>
>> > Hi Stephen,
>> >
>> > You've ht the point bang on. Although my XML knowledge was limited,
>> > I was able to quickly see that the elements and attributes were  
>> named
>> > in a confusing manner.
>> > Also you've explained it in a great way.
>> >
>> > My next question is, can anyone point me in the direction of a
>> > complex mapping tool that is good and fairly easy to use.
>> >
>> > Regards
>> > David Bradley
>> > Senior Web Programmer
>> > Globe Media
>> > Brookfields Way
>> > Manvers
>> > Wath-upon-Dearne
>> > Rotherham
>> > S63 5DL
>> >
>> > Tel: 01709 768231
>> > Fax: 01709 768011
>> > dave@globe-media.com
>> > www.globe-media.com
>> >
>> >
>> > On 6 Jun 2007, at 12:47, Stephen Green wrote:
>> >
>> >> Hi David
>> >>
>> >> Could it be to do with the fact that certain elements like those
>> >> named
>> >> (confusingly, but no matter) 'attributes' may appear in several
>> >> different
>> >> contexts (within 'country' and within 'region', etc)? I think this
>> >> may cause
>> >> problems for a simple xml to database mapping tool like Access  
>> has.
>> >> What you probably need is a more sophisticated one that allows you
>> >> more control. Then you can apply sufficiently complex criteria.  
>> Or,
>> >> more
>> >> to the point, rather than let a wizard in the tool determine your
>> >> database
>> >> structure (which due to the reuses above could cause a simple such
>> >> tool
>> >> problems), what you need is to design your own database with some
>> >> way to distinguish an 'attributes' table related to 'country'  
>> from an
>> >> 'attributes' table related to 'region', etc and then use a more
>> >> complex
>> >> mapping which decides which 'attributes' table the given XML
>> >> belongs to
>> >> based on the parent element name. Maybe I've missed the point  
>> of your
>> >> question - then we'd need more details on what you are doing.
>> >>
>> >> Best regards
>> >>
>> >> Stephen Green
>> >>
>> >>
>> >> ------------------------------------------------------------
>> >> Stephen Green
>> >>
>> >> Senior IT Officer
>> >> Bristol City Council
>> >> Room G34, Romney House
>> >> Romney Avenue
>> >> Bristol  BS99 3HB
>> >> Tel: 0117 922 3794
>> >> Fax: 0117 922 4877
>> >> Email: stephen_green@bristol.gov.uk
>> >>
>> >>
>> >>
>> >>>>> David Bradley <dave@globe-media.com> 6/06/07 09:28:44 >>>
>> >> Hi,
>> >>
>> >> I'm quite certain that this is not a fault with Access. It is  
>> more to
>> >> do with how the XML file has been constructed.
>> >> The XML file did have a reference to a DTD but the source that  
>> I got
>> >> the XML file from will not allow me access to the DTD file.
>> >>
>> >> So is there anywhere to map certain XML tags to fields in the
>> >> database?
>> >>
>> >>
>> >>
>> >>  
>> _____________________________________________________________________
>> >> _
>> >> Please note the new simpler name for our website: http://
>> >> www.bristol.gov.uk
>> >>
>> >> Our email addresses have also changed - visit http://
>> >> www.bristol.gov.uk/bigchange for further details.
>> >>
>> >> Sign-up for our email bulletin giving news, have-your-say  and
>> >> event information at: http://www.bristol.gov.uk/newsdirect
>> >>
>> >>
>> >>
>> >>
>> >>  
>> _____________________________________________________________________
>> >> _
>> >> _
>> >>
>> >> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
>> >> to support XML implementation and development. To minimize
>> >> spam in the archives, you must subscribe before posting.
>> >>
>> >> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>> >> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
>> >> subscribe: xml-dev-subscribe@lists.xml.org
>> >> List archive: http://lists.xml.org/archives/xml-dev/
>> >> List Guidelines: http://www.oasis-open.org/maillists/ 
>> guidelines.php
>> >>
>> >>
>> >
>> >
>> >  
>> _____________________________________________________________________ 
>> _
>> > Please note the new simpler name for our website: http://
>> > www.bristol.gov.uk
>> >
>> > Our email addresses have also changed - visit http://
>> > www.bristol.gov.uk/bigchange for further details.
>> >
>> > Sign-up for our email bulletin giving news, have-your-say  and
>> > event information at: http://www.bristol.gov.uk/newsdirect
>> >
>> >
>> >
>> >
>>
>>
>>
>> _____________________________________________________________________ 
>> __
>>
>> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
>> to support XML implementation and development. To minimize
>> spam in the archives, you must subscribe before posting.
>>
>> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
>> subscribe: xml-dev-subscribe@lists.xml.org
>> List archive: http://lists.xml.org/archives/xml-dev/
>> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>>
>>
>> <schema.xsd>
> ______________________________________________________________________ 
> _
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS