Product Attribute Starting With A Number
Permalink Browser Info Environment
I have a Product Attribute called <3d_name>. When I add it to the XML file, it won't allow me to import the data. When I remove it, it imports fine. Is there something about XML or the Import addon that doesn't like the name starting with a number?
Type: | Discussion |
---|---|
Status: | In Progress |
I would not think a product attribute handle that starts with a number would be a problem, but I don't recall ever trying it myself. Have you checked the c5 log to see if there is an error there? It may provide more information.
Yes there is an error. Import Error: Invalid XML file. Check the following errors:
Fatal Error 5: Extra content at the end of the document (line 28, column: 1)
Fatal Error 5: Extra content at the end of the document (line 28, column: 1)
I have seen this error before when there was a character outside the brackets, but I can't seem to find anything wrong with the syntax... <3d_name>Name</3d_name>, right?
I did a little research into this. It turns out it is illegal for XML tags to start with a number; the spec prohibits it. From what I've read there is no way around this. So, while Import doesn't care if the tag starts with a number, since Import is designed to use XML you will need to rename your product attribute.
That's great, man, just changed a couple of lines of code and the attribute name, and we should be all set. Thanks! Love your addon. Saves me hours of time.