Page 1
Page 1
Started By
Message

SQL/xsd/xml beginner question...need help

Posted on 7/14/16 at 8:53 am
Posted by TheCaterpillar
Member since Jan 2004
76774 posts
Posted on 7/14/16 at 8:53 am
I ran a SQL query to pull some data a vendor needed. Then I converted the data into an XML file (using XML AUTO function in SQL) per their request. However, it didn’t match the xsd schema that the vendor wanted. They have sent me the xsd schema, but I have no clue how to convert my existing SQL data or XML file into their preferred schema.

Any help would be greatly appreciated. If the question doesn’t make sense, tell me why I sound like an idiot. This is all new to me
Posted by jeff5891
Member since Aug 2011
15761 posts
Posted on 7/14/16 at 9:30 am to
Go to stackoverflow.com and ask that question. You will get better responses
Posted by Baers Foot
Louisiana Ragin' Cajuns
Member since Dec 2011
3542 posts
Posted on 7/14/16 at 10:29 am to
Depending on: how different your XML AUTO generated file looks compared to their XSD schema, if this is a one time thing, and the complexity of the xml...it might be easier just go manually do some find/replace voodoo on your generated file to match their schema.

If it's fairly complex, your auto generated file is drastically different than their XSD schema, and this is an ongoing process, then you're going to have to work on a tiny script/program to accomplish this.

I've never done this personally, so someone with more experience could possibly chime in.
Posted by TheCaterpillar
Member since Jan 2004
76774 posts
Posted on 7/14/16 at 10:36 am to
quote:

you're going to have to work on a tiny script/program to accomplish this.


Yep, just talked to our programmers and engineers and they are going to build a program to do this.

And I'm going to miss a deadline.

Fml.

Posted by Breauxsif
Member since May 2012
22290 posts
Posted on 7/14/16 at 2:41 pm to
Hypothetically, the tiny script program is available on global elements, and requires a valid XML schema set.

This feature typically generates valid XML documents. However, if the schema contains one or more of the following, the sample might not be valid:

The xs:key, xs:keyref, and xs:unique identity constraints.
xs:pattern facets.

Enumerations of the xs:QName type.
xs:ENTITY, xs:ENTITIES, and xs:NOTATION types.

Also, note that xs:base64Binary content will be generated only if enumerations occur in the schema for that type.
Posted by Brisketeer
Texas
Member since Aug 2013
1434 posts
Posted on 7/14/16 at 7:53 pm to
Take a look at this link. There are several examples that may help.

FOR XML
first pageprev pagePage 1 of 1Next pagelast page
refresh

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram