Xml (1 Viewer)

Banana

split with a cherry atop.
Local time
Today, 00:49
Joined
Sep 1, 2005
Messages
6,318
Indeed. Given that Sharepoint uses a lot of XML, it was a logical step.

But can I just say I despise XML anyway? ;) Give me good old-fashioned objects anytime of the day over XML, thank you very much.

(If there is any doubt, I dare you to work out a query in CAML and come back proclaiming it is in fact better than SQL. ;) )
 

vbaInet

AWF VIP
Local time
Today, 08:49
Joined
Jan 22, 2010
Messages
26,374
Haha! Not my thing really. But CAML is only a subset of XML. You can never beat the good-old objects though.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 08:49
Joined
Sep 12, 2006
Messages
15,652

i looked at the link

what i still dont understand (eg in their example) is how the xml import builds relational tables

eg their example shows a name and address - but if you have a file with lots of names and lots of addresses, it doesnt seem to build a realtion that says a particular address belongs to a particluar name - and it certainly doesnt add a useful autonumber index for realtional purposes!
 

vbaInet

AWF VIP
Local time
Today, 08:49
Joined
Jan 22, 2010
Messages
26,374
i looked at the link

what i still dont understand (eg in their example) is how the xml import builds relational tables

eg their example shows a name and address - but if you have a file with lots of names and lots of addresses, it doesnt seem to build a realtion that says a particular address belongs to a particluar name - and it certainly doesnt add a useful autonumber index for realtional purposes!

Take XML to be plain data (ignoring the tags), the tags are used for grouping - building a hierarchichal structure for XSLT to use. XSLT interprets XML by defining it for various purposes using those h4, body text which are well understood by the consumer or the object reading the XML. XSLT matches the tags you create with the tags in the XML document so it knows which to call a table, a field name or a record. So the tags you used to group your data in XML must match up with the tags used in XSLT because the parser compares both. That example you saw is a record with 1 being the autonumber. That example even showed how you can transverse the tree to get all employees.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 17:49
Joined
Jan 20, 2009
Messages
12,852
In terms of XML being "meaningless" it has as much meaning as a table in a database as it contains a representation of information. Strictly speaking a field in a table is a meaningless string too. We just associate in our brain with an attrribute of our experience.

The difference is the data structure. Whereas a field in relational database table records a certain attribute across a population, XML data is object centric, meaning that it can hold the entire information about a single object. It is the ultimate multivalue field since each value can hold what is in essence another field ad infinitum.

This object centricity is the point of XML. The entire information about an entity is stored and can be passed as a single object rather than having to process the entire population of data to the extract the records for a single item then have to reconstruct the entire relational framework to read it. The entire structural information and fieldnames are carried inside that file.

An XSL file can transform the file into an arbitrary format by walking the tree of an object. Essentailly they have the same function as queries and reports.
 

wazz

Super Moderator
Local time
Today, 15:49
Joined
Jun 29, 2004
Messages
1,711
...the tags you used to group your data in XML must match up with the tags used in XSLT because the parser compares both.
right. the way i remember it is (i should check this, been a little while):

this, at the top of xml files: <?xml version="1.0" encoding="utf-8" ?>
is a 'standard' that an xml file must use. it's a bit like a web page that has:

<!DOCTYPE htmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">

the web page can reference a set of standards to see if the content of the page meets the standard(s). (also note the html tag has an xmlns (xml namespace) attribute that references a location where the standards are stored). the <?xml version="1.0" encoding="utf-8" ?> node can basically be ignored when pulling stuff out (switch ... case XmlNodeType.XmlDeclaration: ignore this node...) but not when creating the file; it must be there when creating it.

xslt is like a shema that an xml file can reference to see if it meets that standard. (again, check this). i think if you set up an xslt (it might be a different file? a namespace file?) you can force people to create their xml docs a certain way so that parsing them is consistent. could be handy.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 08:49
Joined
Sep 12, 2006
Messages
15,652
I think what we probably need is an easy demonstartion of how to use style sheets and transforms

it just doesnt seem obvious

(in the same way that interfacing access with excel/outlook etc isnt easy until you see a practical example of how someone has done it - and then it is easy to adopt.)
 

Users who are viewing this thread

Top Bottom