Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common types of XML documents?

Status
Not open for further replies.

NMDUC

Programmer
Mar 4, 2006
61
VN
Hi,
XML is flexible, self-descrbing so it can represent many types of data. I wonder what common types of XML documents are. Can you help me, please?

I see that some XML documents have structures like this example

<SVs>
<Sv>
<Publications>
<Title>Detecting changes</Title>
<Title>XML Specifications</Title>
<Title>Topic Maps</Title>
</Publications>
<Id>4729504</Id>
<Name>Duc Minh Nguyen</Name>
<DateOfBirth>15/10/1982</DateOfBirth>
<Address type="home" kl="12">Soi 24 Ram</Address>
</Sv>
<Sv>
<Id>4829501</Id>
<Name>Steve Mason</Name>
<DateOfBirth>2/7/1970</DateOfBirth>
<Address type="work">Soi 24 Ram</Address>
<Publications>
<Title>XML Specifications</Title>
</Publications>
</Sv>
</SVs>

In this type, there are key nodes (Id)whose values are unique. Can you tell me if the type of XML documents that have key nodes like this example is popular or not?

Thank you very much.

Duc
 
[1]>I wonder what common types of XML documents are.
I don't think there is a concept of "common types" to categorize xml document. For element nodes, we sometimes categorize them as being mixed type (having both text nodes and element nodes as their children) or what-do-we-call? "non-mixed" type (having either a text node of CDATA as their child or only element nodes as their children.)

[2]>In this type, there are key nodes (Id)whose values are unique.
In fact, this is no geniune concept of an element being of data type ID, in the sense that its text child contains a character data being unique throughout the document. ID data type is applicable only to an attribute node. Even that, it does not take on the uniqueness until you make out a schema and validate the document against it. Without validation, uniqueness in the sense of id data type does not exist. And the name of the attribute being of id data type is quite free and absolutely not being constraint to be named "id" or "ID" or "Id"... If one needs to make an element's text child (CDATA) unique throughout the document, one has to arrange a "contract" with their users. It cannot even be made that out in the W3C Schema. You have to resort to alternative schema language.
 
Thank you, tsuji. I have learned some knowledge from you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top