开发者

Which kind of trees can be represented by XML

I just started to learn for an advanced database course. And I have one basic question, a standart tree is a connected acyclic graph. The connected refers to that all nodes are connected somehow and acyclic mean no cycles. My question is what other graphs can be represented by an XML file that respects the xml standart?

开发者_运维知识库Maybe directed acyclic graphs, but for each node I can verfiy if a parent is available, so directed seems to be strange. And cycles, I really don't know.


Well, as far as I know you always have to have a unique root tag in an XML document, so that would already give you an 'rooted connected acyclic graph' (rooted tree). Furthermore, you can interpret the names of nodes in an XML document as labels on nodes in your graph. The individual properties could be expressed by functions on the nodes or, if that's more desirable, as labels/predicates.

By definition your XML document always has a tree structure, so the underlying graphs will always be trees.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜