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

Can't find element in SVG file #10

Open
alienlebarge opened this issue Dec 3, 2015 · 0 comments
Open

Can't find element in SVG file #10

alienlebarge opened this issue Dec 3, 2015 · 0 comments

Comments

@alienlebarge
Copy link

I'm trying to change fill color of an SVG.

gulp.task('colors', function() {
  return gulp.src("./src/logo.svg")
    .pipe(xeditor([
      {path: '//g[@id="logo-color"]', attr: {'fill': '#FFFFF'}}
    ]))
    .pipe(gulp.dest('./dest'));
});
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="311px" height="522px" viewBox="0 0 311 522" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
    <!-- Generator: Sketch 3.4 (15575) - http://www.bohemiancoding.com/sketch -->
    <title>logo</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
        <g id="logo-color" sketch:type="MSArtboardGroup" fill="#3C8A2E">
          ... 
        </g>
    </g>
</svg>

But I'm always getting this error:

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: Can't find element at "//g[@id="logo-color"]"

Do not see what I'm doing wrong. Can somebody help me ?

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

No branches or pull requests

1 participant