Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Remove namespaces from elements

New Here ,
Jan 21, 2015 Jan 21, 2015

There is a problem I am experiencing, that others have discussed here Illustrator retains unsavory namespaces in SVGs, can't open it's own export

Basically the AI document retains namespace data from SVG's that have been copied or used in some way to create the AI.

When the document is saved to SVG - these namespace references remain and can result in invalid SVG output.

Does anyone know of a way that these namespaces could be accessed using Illustrator Scripting?

thanks,

Mochael

TOPICS
Scripting
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Valorous Hero ,
Jan 21, 2015 Jan 21, 2015

Not sure about doing it from inside a script, but a script which saves the file and then opens it up as text to remove the unwanted characters, could be possible!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2015 Jan 21, 2015

Yes I'm already doing that with a regex - I would rather be able to detect and remove those before export.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 21, 2015 Jan 21, 2015

Oh, can you describe how you are able to have such a file?  I tried to recreate the problem in the thread by copying and pasting from inkScape, into my AI CC2014, but it did not work- no namespaces were carried over.  Opening the file, I got the validation error- so how did you bring this into AI in the first place?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2015 Jan 21, 2015

I honestly don't know the AI was supplied to me - will try and replicate.

I know it must have been made from an SVG somehow, as it contains namespaces that are injected into the SVG when uploaded to our CMS

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 21, 2015 Jan 21, 2015

So is your namespace issue caused by an operation of handling svgs by your CMS, and not the inkscape/sodipodi as in the example thread?  Would you be able to paste a problem snippet here?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2015 Jan 21, 2015

So under certain circumstances when an SVG is uploaded into our CMS data similar to this is added


<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="2550px" height="2000px" viewBox="0 2000 2550 2000" enable-background="new 0 2000 2550 2000" xml:space="preserve" xmlns:cib="http://connectib.com/connect">

  <path id="outline33" cib:unitID="0" fill="#6FACD3" stroke="#878787" d="M984.7,3258.8l187.2-46.6c0,0,47.1-13.3,64.4,33.4

  l-5,153.5c0,0-1.8,73.1-76.4,98.3l-89.6,23.5l-3-9.8l-13.9,2.4l-0.2,4.4l-64.2,15.9l-7-30l-7.5,1.2l-31.2-130l6.1-1.9l-6.3-30.8

  l8.9-3.7l-2.2-10.5l31.5-54.2l11.6-3.2L984.7,3258.8z" />

</svg>

If you open that document in Illustrator it's fine, it appears under certain circumstances Illustrator loses the namespace declaration and when you save to SVG you still get the property on the path, but no declaration which makes it invalid.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 21, 2015 Jan 21, 2015

I am unable to open it in CC2014.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 21, 2015 Jan 21, 2015
LATEST

Oh and now it just crashes my Illustrator.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines