Xml/Xslt - XML Design

Asked By stan lee
03-Jan-06 06:50 AM
Hi, 

I'm having some trouble with designing an XML document/vocabulary.

Situation:

I have sets of numerical data, that is essentially tabular data captured in xml elements:

<dataset id='1'>
<row/>
<row/>
<row/>
<dataset>
<dataset id='2'>
...
...
</dataset>
...

PROBLEM:
I need to extend this with xml that captures multiple hierarchical relationships between these datasets. Currently I've defined a <datahierarchy/> element that captures a single type of relationship between the datasets:

<datahierarchy>
<tier id='1'>
<dataset>1</dataset>
<dataset>2</dataset>

<tier id='2'>
<dataset>3</dataset>
</tier>
</tier>
...
</datahierarchy>

However, the datasets have several different hierarchal relationships. i.e. where <dataset id='3'> may be the root rather than a child, and have <dataset id='2'> and <dataset id='1'> as children. 

The easy solution would be to capture the different types of data hierarchies in multiple <datahierarchy></datahierarchy> elements. But I am reluctant to do this because it seems like a clumsy and spactially expensive solution. 

Any ideas on how I could capture the hierarchy and relationships of my datasets in xml? 

Could someone provide links to tutorials regarding xml design? I've googled it with very little sucess.

Thanks.

How about  How about

05-Jan-06 12:02 PM
adding an optional <child> tag within each <dataset>:

<dataset id='1'> 
<row/> 
<row/> 
<row/> 
<child>
<childdataset id='2'>
<childdataset id = '3'>
</child>
<dataset> 
<dataset id='2'> 
... 
... 
</dataset> 
... 

I do have a question though.  Do the relationships just based on the dataset id?  Or it's based on some Key value(or attribute) on the row elements?
Create New Account
help
Converting flat xml structure into Hierarchical xml using XSLT .NET Framework Hi All, Please help me in converting the following xml: Source xml: (Above xml represents children information of a single person qeuried from Database) Required format: Thanks Rumana Shaik Xsl Discussions JavaScript (1) XSLT (1) AltovaXML (1) ShaikRe (1) FAQTs (1) XML (1) MVP (1) Lawyer (1) It is
sql query for xml I have a table, table1, the column names are id, name, telephone, fax, address, zip The xml output format I need to have is <root> <table1> <id> 1< / id> <name> John< / name table1> <table1> . . . < / table1> <root> I want to know if it's possible to create a hierarchical xml output like above when all the data are in one table or I need to I will appreciate it if anyone can give me some examples. yes u can create xml like that u need to create manually in loop like / / fetch data in datatable dt dt["fax"].ToString() + "< / fax> "; strXml = strXml + "< / ContactNumber> "; strXml = strXml + "< / HomeAddress> " ; } strXml = strXml +"< / table1> < / root> " SQL / XML Tutorial: SQL / XML, XQuery, and Native XML Programming Languages Introduction Most web applications have connections to databases and use XML to transfer
Use of external xml file in wsp webpart to storing and retriving data Hi, I have created an xml file with this code. Named as PageSize.xml. <?xml version = "1.0" encoding = "ISO-8859-1"?> <Page> <PageSize pSize = "25" / > < / Page> I have put void btnSave_Click(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); strXMLPath = Server.MapPath(@" \ _layouts \ PageSize.xml"); xmlDoc.Load(strXMLPath); XmlNode xNode1 = xmlDoc.DocumentElement.SelectSingleNode("PageSize"); xNode1.Attributes.GetNamedItem("pSize").InnerText = txtPageSize path 'C: \ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 12 \ template \ layouts \ PageSize.xml' is denied. I do it like this because i want to get it's PageSize relational data; the Windows file system for storing semi-structured data and eXtensible Markup Language (XML) files to hold hierarchical data. The need to aggregate and manage data in a central location is a very
XML / XSLT / XSD / Xpath What is XML in context to .Net What is XSLT and how to use it What is XSD and its use What is Xpath in .Net XML: http: / / wiki.contextgarden.net / Getting_Started_with_XML_and_ConTeXt_using_TEXML http: / / batmat.net / blog / post / 2008 / 01 / 13 / How-to load-a-XML-Spring-context-lazily-by-default http: / / www.w3schools.com / xml / default.asp http: / / www.w3.org / XML / http: / / www.xml.com / XSLT: http: / / www.w3.org / TR / xslt http: / / www.w3schools.com
XML-asp.net Hi, i want to know the use of xml files in asp.net webpage application. Where we use xml files in asp.net application. give sample code and list out the usage of xml file in asp.net. I just used this xml in adrotator control only. Any other usage of this xml file in asp.net? HI Data is often made available to Web applications in XML format. However, XML data is inherently hierarchical, and you might want to be able to use the XML