problems in group element with attribute when using “colon”

Home Evil Mad Scientist Forums AxiDraw problems in group element with attribute when using “colon”

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #29740

    This link explains how layers need to be named to achieve different drawing behaviours.

    Under “Adding layers outside of Inkscape” it also says that each <g> group needs to have “inkscape:groupmode=”layer” and “inkscape:label=”1-myName”.

    I am making an openframeworks app that generates a custom svg using svgtiny. But due to the colon in “inkscape:groupmode” the app crashes.
    “libc++abi.dylib: terminating with uncaught exception of type Poco::XML::SAXParseException: SAXParseException”

    The app generates a proper SVG successfully when I replace the colon with a dash like so “inkscape-groupmode”. Not sure yet if the axidraw will like it.

    My question is if I can remove the “inkscape:” part and only leave “groupmode” and “label” attribute?
    Or is there any other work around you might know to prepare the svg correctly, so that axidraw will parse the layers correctly?

    It seems SVGs don’t like colons that much:


    Windell Oskay

    Both the crash ( SAXParseException ) and the stackoverflow link should be pointing you in the correct direction: You shouldn’t use a “bare” colon if you’re using any frameworks that recognize the SVG tree, since they will conflict with any declared namespaces.

    What to do about it depends a lot on what you are actually doing, and at what stage it’s crashing.

    If you’re seeing a crash while building the file, then you’re probably using some sort of framework that parses or otherwise understands an SVG (XML) tree. In that case, you need to either register the namespace and build the namespaced object correctly, or (with a very different approach) build the SVG by simple string concatenation, in which case you can use colons directly.

    If you’re seeing the crash while loading the SVG into something else (trying to parse it after you made it), it sounds like you didn’t add the right namespaces to the file.


    Thanks for the reply.

    So I take it
    inkscape:label = “1 +D250name” and inkscape:groupmode=”layer”
    both really need the “inkscape:”
    and axidraw API will not work with just
    label = “1 +D250name” and groupmode=”layer” ?

    For now I will follow your suggestion and use the simple string concatenation approach.

    Windell Oskay

    The AxiDraw software reads SVG. The syntax that we use is properly namespaced SVG, while versions with equals signs or hyphens are not.


    You are saying that using eraul signs and hyphens in the SVG are not proper?

    you are showing us to do just that

    and the example SVGs that come with Axidraw-Examples-1-2.4 also have that in them

    I am confused.


    Thank you again for taking the time to respond.

    I understand now.
    Inside the SVG I have to make sure that I am setting up the proper namespace for inkscape usage.

    The following block needs to be included otherwise my svg reader throughs an error about the included colon.


    Thank you!

    Windell Oskay

    Great; that looks like an approach that would work!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘problems in group element with attribute when using “colon”’ is closed to new replies.