Click here to Skip to main content
15,887,175 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralEgypt was troubled by the horrible ASP Pin
RickZeeland29-Apr-23 20:18
mveRickZeeland29-Apr-23 20:18 
GeneralRe: Egypt was troubled by the horrible ASP Pin
Mike Hankey30-Apr-23 5:40
mveMike Hankey30-Apr-23 5:40 
GeneralRe: Egypt was troubled by the horrible ASP Pin
kmoorevs1-May-23 8:44
kmoorevs1-May-23 8:44 
QuestionA generalized tabular -> xml engine in C# - any interest? Pin
honey the codewitch29-Apr-23 19:51
mvahoney the codewitch29-Apr-23 19:51 
AnswerRe: A generalized tabular -> xml engine in C# - any interest? Pin
englebart30-Apr-23 5:42
professionalenglebart30-Apr-23 5:42 
GeneralRe: A generalized tabular -> xml engine in C# - any interest? Pin
honey the codewitch30-Apr-23 5:57
mvahoney the codewitch30-Apr-23 5:57 
AnswerRe: A generalized tabular -> xml engine in C# - any interest? Pin
PIEBALDconsult1-May-23 7:14
mvePIEBALDconsult1-May-23 7:14 
GeneralRe: A generalized tabular -> xml engine in C# - any interest? Pin
honey the codewitch1-May-23 7:22
mvahoney the codewitch1-May-23 7:22 
PIEBALDconsult wrote:
I would be interested in what you envision as a way of specifying the schema of the XML to produce.


That's where a lot of that work I was talking about comes in.

On that run where we did it, maybe back in 2004 or 2005, we used annotated XSD (XML Schema) and recognized mapping annotations that wherever we could, were already defined by microsoft.

So if you actually plug in a schema it can generate those column names I mentioned for you, or conversely, take tabular data and XMLize it.

XML
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
            xmlns:sql="urn:schemas-microsoft-com:mapping-schema">  
  <xsd:element name="Contact" sql:relation="Person.Contact" >  
   <xsd:complexType>  
     <xsd:sequence>  
        <xsd:element name="FName"  
                     sql:field="FirstName"   
                     type="xsd:string" />   
        <xsd:element name="LName"    
                     sql:field="LastName"    
                     type="xsd:string" />  
     </xsd:sequence>  
        <xsd:attribute name="ConID"   
                       sql:field="ContactID"   
                       type="xsd:integer" />  
    </xsd:complexType>  
  </xsd:element>  
</xsd:schema>  


And when we needed additional annotations we just added another namespace with more attributes defined in it, like microsoft did with the "msdata" namespace (that's just the prefix, i forget the URN)

or, alternatively, if you're going the explicit route you can make your csv field a nested element it would be like employee!1!employeeID!element instead of just employee!1!employeeID

One problem you'll find with JSON, is while XML makes sparse use of "arrays" in xml attributes, JSON basically uses arrays in its fields everywhere. When you go to map that to relational data, you'll have to come up with a scheme probably to pack subitems into a field using a join, and it will make your rowset significantly bigger breaking it out like that, but the alternative is denormalizing into a delimited list, if that makes sense. That might be tricky with JSON because you lose normalization of any nested objects.

Also remember arrays are ordered but fields are not in JSON.

Aside from that, less datatypes, but in some ways that makes it easier.

If you want to support JSON schema it's going to be quite difficult, but then so is XSD, because they're both lexically oriented rather than data oriented.
To err is human. Fortune favors the monsters.

GeneralRe: A generalized tabular -> xml engine in C# - any interest? Pin
PIEBALDconsult1-May-23 7:58
mvePIEBALDconsult1-May-23 7:58 
AnswerRe: A generalized tabular -> xml engine in C# - any interest? Pin
jschell1-May-23 11:40
jschell1-May-23 11:40 
GeneralRe: A generalized tabular -> xml engine in C# - any interest? Pin
honey the codewitch1-May-23 11:44
mvahoney the codewitch1-May-23 11:44 
GeneralRe: A generalized tabular -> xml engine in C# - any interest? Pin
PIEBALDconsult2-May-23 3:20
mvePIEBALDconsult2-May-23 3:20 
GeneralRe: A generalized tabular -> xml engine in C# - any interest? Pin
jschell2-May-23 11:46
jschell2-May-23 11:46 
JokeI'm sorry, your dad was pronounced dead Pin
honey the codewitch29-Apr-23 19:22
mvahoney the codewitch29-Apr-23 19:22 
GeneralRe: I'm sorry, your dad was pronounced dead Pin
Daniel Pfeffer30-Apr-23 7:01
professionalDaniel Pfeffer30-Apr-23 7:01 
GeneralRe: I'm sorry, your dad was pronounced dead Pin
jmaida30-Apr-23 16:26
jmaida30-Apr-23 16:26 
Generalworldle 463 4/6 Pin
jmaida29-Apr-23 14:55
jmaida29-Apr-23 14:55 
GeneralWordle 680 Pin
Sandeep Mewara29-Apr-23 9:24
mveSandeep Mewara29-Apr-23 9:24 
GeneralRe: Wordle 680 Pin
StarNamer@work29-Apr-23 13:11
professionalStarNamer@work29-Apr-23 13:11 
GeneralRe: Wordle 680 Pin
OriginalGriff29-Apr-23 19:17
mveOriginalGriff29-Apr-23 19:17 
GeneralRe: Wordle 680 Pin
Sandeep Mewara29-Apr-23 20:30
mveSandeep Mewara29-Apr-23 20:30 
GeneralRe: Wordle 680 Pin
Amarnath S29-Apr-23 21:17
professionalAmarnath S29-Apr-23 21:17 
GeneralRe: Wordle 680 Pin
Amarnath S29-Apr-23 16:42
professionalAmarnath S29-Apr-23 16:42 
GeneralRe: Wordle 680 Pin
OriginalGriff29-Apr-23 19:16
mveOriginalGriff29-Apr-23 19:16 
GeneralRe: Wordle 680 - 4 4 me Pin
pkfox29-Apr-23 22:13
professionalpkfox29-Apr-23 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.