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 representation of tab-delimited text files?

Well, I guess that in any discussion of this one should include the bizarre XSD formulation:


<Row>
    
<A>foo</A>
    
<B xsi:nil="true"/>
    
<C>bar</C>
</Row>

But I would classify anyone who uses that as slightly insane.

Michael Kay
Saxonica

On 22 Sep 2016, at 15:48, Costello, Roger L. <costello@mitre.org> wrote:

Hi Folks,

I have a tab-delimited text file. Here is one row of the file:

A             B             C
foo                         bar

The value in field B is optional. In this particular row there is no value for B so it is empty.

I could represent the text file in XML by creating an element for each field and then putting a wrapper element around the elements. For an empty field I could represent that by omitting the element. So here is one way to represent the row:

<Row>
   
<A>foo</A>
   
<C>bar</C>
</Row>

 

Notice that I omitted the <B> element because the B field is empty.

 

Alternatively, I could represent an empty field with an empty element:

 

<Row>
   
<A>foo</A>
   
<B/>
   
<C>bar</C>
</Row>

 

Notice the empty <B> element.

 

What other ways are there for representing the row? I am particularly interested in seeing other ways that people represent empty fields.  (There are probably an infinite number of ways that the row could be represented. I am interested in the ways that the row is commonly represented.)

 

/Roger

 




[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