[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML into a database

  • From: "Stephen Green" <stephengreenubl@g...>
  • To: "David Bradley" <dave@g...>, xml-dev@l...
  • Date: Mon, 11 Jun 2007 19:50:40 +0100

Re:  XML into a database
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@g...> 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@g...
> 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@g...> 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@g...
> > 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@b...
> >>
> >>
> >>
> >>>>> David Bradley <dave@g...> 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@l...
> >> subscribe: xml-dev-subscribe@l...
> >> 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@l...
> subscribe: xml-dev-subscribe@l...
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:complexType name="T_town">
		<xs:sequence>
			<xs:element ref="attributes" minOccurs="0"/>
			<xs:element ref="description" minOccurs="0"/>
			<xs:element ref="residence" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="displaysize" type="xs:string"/>
		<xs:attribute name="codelayout" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="T_texts">
		<xs:sequence>
			<xs:element ref="text" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="T_text-value">
		<xs:sequence>
			<xs:element ref="para" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="view" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="T_text-name">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="contextual" type="xs:string"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="T_text">
		<xs:sequence>
			<xs:element ref="text-name"/>
			<xs:element ref="text-value"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="T_residence">
		<xs:sequence>
			<xs:element ref="attributes" minOccurs="0"/>
			<xs:element ref="description" minOccurs="0"/>
			<xs:element ref="product" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="displaysize" type="xs:string"/>
		<xs:attribute name="codelayout" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="T_region">
		<xs:sequence>
			<xs:element ref="attributes" minOccurs="0"/>
			<xs:element ref="description" minOccurs="0"/>
			<xs:element ref="town" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="displaysize" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="T_product">
		<xs:sequence>
			<xs:element ref="attributes" minOccurs="0"/>
			<xs:element ref="description" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="T_images">
		<xs:sequence>
			<xs:element ref="image" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="T_image">
		<xs:sequence>
			<xs:element ref="attributes" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="T_description">
		<xs:sequence>
			<xs:element ref="texts" minOccurs="0"/>
			<xs:element ref="images" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="T_country">
		<xs:sequence>
			<xs:element ref="attributes" minOccurs="0"/>
			<xs:element ref="description" minOccurs="0"/>
			<xs:element ref="region" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="displaysize" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="T_catalog">
		<xs:sequence>
			<xs:element ref="country" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="views" type="xs:byte"/>
		<xs:attribute name="version" type="xs:decimal"/>
		<xs:attribute name="startpage" type="xs:byte"/>
		<xs:attribute name="reference" type="xs:string"/>
		<xs:attribute name="filedate" type="xs:string"/>
		<xs:attribute name="edition" type="xs:string"/>
		<xs:attribute name="catalognumber" type="xs:byte"/>
		<xs:attribute name="brandname" type="xs:string"/>
		<xs:attribute name="author" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="T_attributes">
		<xs:sequence>
			<xs:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="T_attribute-value">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="view" type="xs:string"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="T_attribute-name">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="contextual" type="xs:string"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="T_attribute">
		<xs:sequence>
			<xs:element ref="attribute-name"/>
			<xs:element ref="attribute-value"/>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="town" type="T_town"/>
	<xs:element name="texts" type="T_texts"/>
	<xs:element name="text-value" type="T_text-value"/>
	<xs:element name="text-name" type="T_text-name"/>
	<xs:element name="text" type="T_text"/>
	<xs:element name="residence" type="T_residence"/>
	<xs:element name="region" type="T_region"/>
	<xs:element name="product" type="T_product"/>
	<xs:element name="para" type="xs:string"/>
	<xs:element name="images" type="T_images"/>
	<xs:element name="image" type="T_image"/>
	<xs:element name="description" type="T_description"/>
	<xs:element name="country" type="T_country"/>
	<xs:element name="catalog" type="T_catalog"/>
	<xs:element name="attributes" type="T_attributes"/>
	<xs:element name="attribute-value" type="T_attribute-value"/>
	<xs:element name="attribute-name" type="T_attribute-name"/>
	<xs:element name="attribute" type="T_attribute"/>
</xs:schema>


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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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