473,698 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML from existing XSD

3 New Member
I am VERY new to XML and I am very confussed. Hoping someone could shead some light on my problems.

IS this even do-able and if so what am i doing wrong

WHAT CURRENTLY EXISTS:

I have an existing XSD file that has all my XML tags that currently exist in my DB, it has the correct structrure for recursive tags (ex: if a person can have more then one address the adress tags are set to UNBOUND, the whole 9 yards)

The PROBLEM:
Some of my clients are unable to provide me with an XML file (in a timely fashion) so what I need to be able to do is take ANY flat file (sometimes multiple flat files, such as EXCEL files) and map each column within these files to my existing XSD tags then convert the XLS to XML.
I have been able to do this with one flat file (not multiple which isnt a big deal except) I am unable to get a recurrion from that flat file. IE when a person has more then one address how can i get it add a second input.

I simply need a quick way of converting any of my clients existing data files into an xml file that will import into my DB based on the XSD schema I have, and I need it to be able to account for multiple instances in some tags.


Full on example:
How my XML should be formated
<ROOT>
<KEY>
other demographic elements
</KEY>
<ADDRESS>
<ADD> one row record on my data file can have multiple ADD's within the 1 ADDRESS tag
</ADD>
</ADDRESS>
</ROOT>

Sample of XLS file headings:
Unique_ID FName LName Address1 City1 State1 Address2 City2 State2

Withing the one ROOT element (row existing for 1 individual on the data file), how do I map address2 ... to exist as a second ADD in the 1 ADDRESS tag for with out creating a SECOND ROOT tag for the address.

HELP PLEASE.

Thanks
Sep 4 '07 #1
3 2244
jkmyoung
2,057 Recognized Expert Top Contributor
Could you show us an example of a 2nd row after the first row? Where does one set of data end and the next begin?
Sep 5 '07 #2
mchapman13
3 New Member
The xls will have something like

Sample data on the excel sheet

123 john doe anystreet anycity anystate anystreet2 anycity2 anystate2
234 jane smith mystreet mycity mystate
345 sally mae herstreet hercity herstate herstreet2 hercity2 herstate2

NEEDED OUTCOME IN XML

<ROOT>
<KEY>
<UNID>123</UNID>
<FName>john</FName>
<LName>doe</LName>
</KEY>
<ADDRESS>
<ADD>
<STREET>anystre et</STREET>
<CITY>anycity </CITY>
<STATE>anystate </STATE>
</ADD>
<ADD>
<STREET>anystre et2</STREET>
<CITY>anycity 2</CITY>
<STATE>anystate 2</STATE>
</ADD>
</ADRESS>
</ROOT>
<ROOT>
<KEY>
<UNID>234</UNID>
<FName>jane</FName>
<LName>smith</LName>
</KEY>
<ADDRESS>
<ADD>
<STREET>mystree t</STREET>
<CITY>mycity</CITY>
<STATE>mystat e</STATE>
</ADD>
</ADDRESS>
</ROOT>
<ROOT>
<KEY>
<UNID>345</UNID>
<FName>sally</FName>
<LName>mae</LName>
</KEY>
<ADDRESS>
<ADD>
<STREET>herstre et</STREET>
<CITY>hercity </CITY>
<STATE>herstate </STATE>
</ADD>
<ADD>
<STREET>herstre et2</STREET>
<CITY>hercity 2</CITY>
<STATE>herstate 2</STATE>
</ADD>
</ADRESS>
</ROOT>


my xsd looks like this for the address field:

<xs:element name="ADDRESS">
<xs:complexType >
<xs:sequence>
<xs:element name="ADD" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element name="STREET" type="xs:string " minOccurs="0" />
<xs:element name="CITY" type="xs:string " minOccurs="0" />
<xs:element name="STATE" type="xs:string " minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Sep 5 '07 #3
mchapman13
3 New Member
Has any one been able to look at this and help me figure out if this is something that is do-able
Sep 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1662
by: Srinath Avadhanula | last post by:
Hello, I wanted to connect to an already existing MATLAB application from python. From the MATHWORKS documentation at: http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/ch07cl24.html I see that to connect to an already existing MATLAB application, I
2
25176
by: Nico Grubert | last post by:
Hi there, I would like to open an existing file that contains some lines of text in order to append a new line at the end of the content. My first try was: >>> f = open('/tmp/myfile', 'w') #create new file for writing >>> f.writelines('123') #write first line >>> f.close()
5
2879
by: Nadav | last post by:
Hi, Introduction: ************************************************************ I am working on a project that should encrypt PE files ( Portable executable ), this require me to inject some code to existing PEs. First, I have tried: 1. to inject some code to the end of the ‘.text’ segment of an existing PE 2. to set the entry point RVA to the address of the injected code 3. at the end of the injected code I have set a jmp to the...
0
1051
by: Larry Lau | last post by:
Hi, I would like to know if it is possible to launch a new browser instance from an existing browser instance with a separated newly created session. window.open(url) already keep you in the same session as expected. Problem I am trying to solve... 1. A url pointing to a document is sent to a user in email. (document can only be accessed by this user)
1
1100
by: Dabbler | last post by:
I need to add a photo gallery component to an existing asp.net application. I'm not sure how to create the gallery component, as I don't want it compiled in the existing apps dll's but separate dll and separate project. Can someone give me a short comment on the best way to do this to create addon functionality so it doesnt conflict with existing app namespace but can be placed into an existing app page and folder? Thanks much.
0
3179
by: Joe Greene | last post by:
I'm trying to add an existing Webservice project to an existing solution. I open the solution and in Visual Studio Solution Explorer right click on the solution. Then select "Add/Existing Project From Web...". In the "Add Existing Project From Web" dialog, I enter the URL "http://crush/wscts" where crush is the server's name and wscts is the Webservice. This takes me to an "Add Existing Projec" dialog which has "My Documents" in the...
1
4143
by: gssstuff | last post by:
Hi I have a need to send data from Access to an existing Excel template that I am using for reporting purposes. The nature of the data in the Access data table does not lend itself to a simple "CopyFromRecordset" (at least I don't think so) I got some info from the microsoft: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q247412&ID=KB;EN-US;Q247412&LN=EN
5
1885
by: igotyourdotnet | last post by:
I have a question on atlas: I can create an 'atlas project' and I can add atlas controls fine. but when I try and add an atlas control to an existing asp.net web app I can't, Why? I did notice that the web.cofig file is different then a normal web app web.config. Do I need to add anything to the web.config file of my existing web app or no? I have the Microsfot.Web.Atlas.dll referenced in my web app. what else do I need to do to add...
1
3952
by: =?Utf-8?B?d2lubGlu?= | last post by:
Hello Using VS 2005 VB.net when a class library gets created you can right click the project and add a Windows Application and then set it as the "startup project" then in the Windows application you can add a reference to that class library in the project by right clicking the Windows Application and selecting "Add Reference" and you will see the project under the "Projects" tab and add the project containing its class library to the...
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9026
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.