Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

How to visualize my xml data?

0 votes

Hi everyone,

I'm trying to open a xml file with yEd to visualise data in hirachical binary tree structure. First, when I import my xml file, it asks XSL file that I don't have! Secondly the nodes in my tree must have either 2 children or no child (Binary tree). 

Here I bring my xml file :

<?xml version="1.0" encoding="UTF-8"?>
-<Mpeg7 xsi:schemaLocation="urn:mpeg:mpeg7:schema:2001 .\Mpeg7-2001.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" xmlns="urn:mpeg:mpeg7:schema:2001">
-<Description xsi:type="urn:ContentEntityType" xmlns:urn="urn:mpeg:mpeg7:schema:2001">
-<MultimediaContent xsi:type="urn:ImageType">
-<Image>
-<CreationInformation>
-<Creation>
<Title>MPEG-7 description of an image</Title>
</Creation>
-<RelatedMaterial id="ImageFile">
-<MediaLocator>
<MediaUri>/imatge/jzolfaghari/workspace/imageplus/testImage2.png</MediaUri>
</MediaLocator>
</RelatedMaterial>
-<RelatedMaterial id="PartitionSearchFile">
-<MediaLocator>
<MediaUri>/imatge/jzolfaghari/workspace/imageplus/tests/data_r/polsar/testImage2-my_Part.prl</MediaUri>
</MediaLocator>
</RelatedMaterial>
</CreationInformation>
-<SpatialDecomposition id="BinaryPartitionTree" size="15" overlap="true" gap="false">
<StillRegion id="1"/>
<StillRegion id="2"/>
<StillRegion id="3"/>
<StillRegion id="4"/>
<StillRegion id="5"/>
<StillRegion id="6"/>
<StillRegion id="7"/>
<StillRegion id="8"/>
-<StillRegion id="9">
<Relation type="Significance" strength="0.000000"/>
<Relation type="MergingOrder" id="1"/>
-<SpatialDecomposition overlap="false" gap="false">
<StillRegionRef idref="Region6"/>
<StillRegionRef idref="Region8"/>
</SpatialDecomposition>
</StillRegion>
-<StillRegion id="Region10">
<Relation type="Significance" strength="0.000000"/>
<Relation type="MergingOrder" id="2"/>
-<SpatialDecomposition overlap="false" gap="false">
<StillRegionRef idref="Region2"/>
<StillRegionRef idref="Region3"/>
</SpatialDecomposition>
</StillRegion>
-<StillRegion id="Region11">
<Relation type="Significance" strength="0.000000"/>
<Relation type="MergingOrder" id="3"/>
-<SpatialDecomposition overlap="false" gap="false">
<StillRegionRef idref="Region5"/>
<StillRegionRef idref="Region7"/>
</SpatialDecomposition>
</StillRegion>
-<StillRegion id="Region12">
<Relation type="Significance" strength="0.000000"/>
<Relation type="MergingOrder" id="4"/>
-<SpatialDecomposition overlap="false" gap="false">
<StillRegionRef idref="1"/>
<StillRegionRef idref="10"/>
</SpatialDecomposition>
</StillRegion>
-<StillRegion id="13">
<Relation type="Significance" strength="0.000000"/>
<Relation type="MergingOrder" id="5"/>
-<SpatialDecomposition overlap="false" gap="false">
<StillRegionRef idref="9"/>
<StillRegionRef idref="11"/>
</SpatialDecomposition>
</StillRegion>
-<StillRegion id="14">
<Relation type="Significance" strength="0.000000"/>
<Relation type="MergingOrder" id="6"/>
-<SpatialDecomposition overlap="false" gap="false">
<StillRegionRef idref="4"/>
<StillRegionRef idref="12"/>
</SpatialDecomposition>
</StillRegion>
-<StillRegion id="15">
<Relation type="Significance" strength="0.000000"/>
<Relation type="MergingOrder" id="7"/>
-<SpatialDecomposition overlap="false" gap="false">
<StillRegionRef idref="13"/>
<StillRegionRef idref="14"/>
</SpatialDecomposition>
</StillRegion>
</SpatialDecomposition>
</Image>
</MultimediaContent>
</Description>

</Mpeg7>     

Could anyone help me to visualize my binary tree?

Thank you

Javad

in Help by

1 Answer

0 votes

First, the data you posted is not XML. There are lots of '-<' character sequences in your sample which are not valid in XML.

Second, even after sanitizing your sample (i.e. replacing '-<' with '<'), your data does not describe a binary tree. E.g. element <SpatialDecomposition> has 15 child elements.

Third, although yEd asks for a custom XSLT stylesheet when using the "XML+XSL" import, it does provide a couple of predefined stylesheets as well. These predefined stylesheets are available through the "XSL File for" drop down list. E.g. importing a sanitized version of your sample with the predefined stylesheet "XML-Tree" results in this diagram.

by [yWorks] (160k points)
Legal Disclosure | Privacy Policy
...