Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unbound namespace prefix" & wiped files #1530

Open
twwn opened this issue Aug 19, 2021 · 4 comments
Open

"Unbound namespace prefix" & wiped files #1530

twwn opened this issue Aug 19, 2021 · 4 comments
Labels

Comments

@twwn
Copy link

twwn commented Aug 19, 2021

Describe the bug
Trying to run svgo on SVG originally based on KanjiVG such as the one contained in this archive causes it to bug out with Error: Error in parsing SVG: Unbound namespace prefix: "kvg" and, if called on a folder, to wipe other opened SVG files in the progress (as in: they become 0 byte files).

Output:

Error: Error in parsing SVG: Unbound namespace prefix: "kvg"
Line: 49
Column: 34
Char: >
File: 03005.svg
    at processSVGData (/usr/lib/node_modules/svgo/lib/svgo/coa.js:367:11)
    at /usr/lib/node_modules/svgo/lib/svgo/coa.js:344:7
    at async Promise.all (index 0)
    at async Command.action (/usr/lib/node_modules/svgo/lib/svgo/coa.js:237:7)
    at async Promise.all (index 0)

To Reproduce
Steps to reproduce the behavior:

  1. svgo 03005.svg

Expected behavior
svgo does its magic.

Desktop (please complete the following information):

  • SVGO 2.4.0, 2.5.0
  • NodeJs 16.7.0. 16.8.0
  • OS: Arch
@twwn twwn added the bug label Aug 19, 2021
@TrySound
Copy link
Member

Looks like kvg namespace is defined in unusual way not supported by sax parser we use.

@TrySound TrySound reopened this Sep 16, 2021
@pritulaziah
Copy link

pritulaziah commented Nov 9, 2022

Hello everyone! Maybe my solution will help someone

@Lonli-Lokli
Copy link

Lonli-Lokli commented Aug 15, 2024

I also have error Unbound namespace prefix: 'xlink' with this svg

<svg viewBox="0 0 16 16">
    <path id="wifi3" d="M8,0C5.2,0,2.4,0.8,0,2.2l1.3,2.3c4.1-2.4,9.2-2.4,13.3,0L16,2.2C13.6,0.7,10.8,0,8,0z" />
    <path id="wifi2" d="M2.7,6.8L4,9.2c2.5-1.5,5.5-1.5,8,0l1.3-2.4C11.7,5.9,9.9,5.4,8,5.4C6.1,5.4,4.3,5.9,2.7,6.8z" />
    <path id="wifi1" d="M5.4,11.5L8.1,16l2.6-4.6c-0.8-0.5-1.7-0.7-2.6-0.7C7.2,10.7,6.2,11,5.4,11.5z" />
    <animate xlink:href="#wifi1" attributeName="fill-opacity" dur="1.2s" values="0.5;1;1;1;0.5"
        repeatCount="indefinite" />
    <animate xlink:href="#wifi2" attributeName="fill-opacity" dur="1.2s" values="0.5;0.5;1;1;0.5"
        repeatCount="indefinite" />
    <animate xlink:href="#wifi3" attributeName="fill-opacity" dur="1.2s" values="0.5;0.5;0.5;1;0.5"
        repeatCount="indefinite" />
</svg>

@GreLI
Copy link
Member

GreLI commented Aug 17, 2024

@Lonli-Lokli yep, this is not a proper XML, xlink namespace is not defined. Should be something like <svg xmlns:xlink="http://www.w3.org/1999/xlink"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants