Conversion from SVG file to XML file

31,723

Solution 1

1) In Android Studio press File > New > Vector Asset. Select SVG file in Path.

enter image description here

You will get a new XML file in drawables folder.

Or you can use these methods.

2) http://inloop.github.io/svg2android/

3) http://a-student.github.io/SvgToVectorDrawableConverter.Web/ with checkbox "Specify --fix-fill-type".

Solution 2

SVG file is already in XML format. But it describes a picture. You can use a graphic programs to convert it to other picture formats, e.g. BMP, PNG which can be then inserted as an Image element into your diagram drawing canvas. (See also chapter "Using the Image Manager" in the help file)

The XML file which can be imported into your EA model using the XMI Import and Export tool must contain an UML model in the XMI format, not just a picture or a printscreen

Solution 3

You can use Android Development Studio (Version >1.4):-

-Create a project

-In any of the folder inside resource folder, right click and choose option 'New', in that choose 'Vector Asset'.

To use svg in android application it is required to be converted into xml.

Android will automatically convert your svg to xml, and you can get your xml file from resource folder.

Solution 4

No that won't be possible. SVG is a graphics format, so it only contains information about image of your diagram, not about the contents of the UML model it represents. It doesn't know about UML, so you'll never be able to use that as a format to import something into EA.

What you need is an XMI file. XMI is the standard for UML models interchange. Check the documentation of your design tool to find out if there is an XMI export facility.

Share:
31,723

Related videos on Youtube

Loganathan Sarangan
Author by

Loganathan Sarangan

Updated on July 15, 2022

Comments

  • Loganathan Sarangan
    Loganathan Sarangan almost 2 years

    Can you explain how to convert SVG files to XML files?

    I am having design tool(EB guide) which generates SVG file format (contains state diagram). I need to use this SVG file in order to view the state diagram in Enterprise architect UML tool.

    But, EA tool is not supporting SVG file. so i try to convert SVG file into xml file and then import in to EA tool.

    Is it possible to convert this SVG file format in to XML file format? is there any conversion tool available.

    logu

  • Tomalak
    Tomalak over 9 years
    SVG is XML. It's merely rendered as a graphic.
  • Geert Bellekens
    Geert Bellekens over 9 years
    @Tomalak The way that is is stored isn't relevant in this case. (xmi is xml as well). It is the type of information that is stored that is relevant. SVG -> graphics, XMI -> UML Model
  • Someone Somewhere
    Someone Somewhere almost 4 years
    does Inkscape require a subscription to do the conversion ?